Skip to content

Commit

Permalink
modify the code
Browse files Browse the repository at this point in the history
Signed-off-by: ZackSoul <[email protected]>
  • Loading branch information
ZackSoul committed Dec 4, 2023
1 parent 8c9ed77 commit 6e99aee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tools-v2/pkg/cli/command/curvebs/delete/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
)

const (
snapshotExample = `$ curve bs delete snapshot`
snapshotExample = `$ curve bs delete snapshot --path /test111/test222 --user root --snapshotFailed=false`
)

type SnapShotCommand struct {
Expand Down Expand Up @@ -80,6 +80,7 @@ func (sCmd *SnapShotCommand) AddFlags() {
func (sCmd *SnapShotCommand) Init(cmd *cobra.Command, args []string) error {
snapshotAddrs, err := config.GetBsSnapshotAddrSlice(sCmd.Cmd)
if err.TypeCode() != cmderror.CODE_SUCCESS {
sCmd.Error = err
return err.ToError()
}
sCmd.snapshotAddrs = snapshotAddrs
Expand Down
5 changes: 3 additions & 2 deletions tools-v2/pkg/cli/command/curvebs/list/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package snapshot
import (
"encoding/json"
"fmt"
snapshotutil "github.com/opencurve/curve/tools-v2/internal/utils/snapshot"
"strconv"
"time"

snapshotutil "github.com/opencurve/curve/tools-v2/internal/utils/snapshot"

cmderror "github.com/opencurve/curve/tools-v2/internal/error"
cobrautil "github.com/opencurve/curve/tools-v2/internal/utils"
basecmd "github.com/opencurve/curve/tools-v2/pkg/cli/command"
Expand Down Expand Up @@ -114,7 +115,7 @@ func (sCmd *SnapShotCommand) RunCommand(cmd *cobra.Command, args []string) error
row[cobrautil.ROW_STATUS] = fmt.Sprintf("%d", item.Status)
row[cobrautil.ROW_SNAPSHOT_SEQNUM] = fmt.Sprintf("%d", item.SeqNum)
row[cobrautil.ROW_FILE_LENGTH] = fmt.Sprintf("%d", item.FileLength)
row[cobrautil.ROW_PROGRESS] = fmt.Sprintf("%d", item.Progress)
row[cobrautil.ROW_PROGRESS] = fmt.Sprintf("%.2f", item.Progress)
row[cobrautil.ROW_CREATE_TIME] = time.Unix(int64(item.Time/1000000), 0).Format("2006-01-02 15:04:05")
rows = append(rows, row)
}
Expand Down

0 comments on commit 6e99aee

Please sign in to comment.