@@ -473,17 +473,22 @@ func startXaction(c *cli.Context, xargs *xact.ArgsMsg, extra string) error {
473473
474474 switch xargs .Kind {
475475 case apc .ActRebalance :
476- actionDone (c , "Started global rebalance. To monitor the progress, run 'ais show rebalance'" )
476+ var s string
477+ if xargs .Flags & xact .FlagRemoveMisplaced != 0 {
478+ s = " (cleanup mode)"
479+ }
480+ actionDonef (c , "Started rebalance[%s]%s. To monitor the progress, run 'ais show rebalance'" , xid , s )
481+
477482 case apc .ActResilver :
478483 const add = " To monitor the progress, run 'ais show job " + apc .ActResilver + "'"
479484 var s string
480485 if xid != "" {
481486 s = "[" + xid + "]"
482487 }
483488 if xargs .DaemonID != "" {
484- actionDone (c , fmt . Sprintf ( "Started %s%s on %s." + add , apc .ActResilver , s , meta .Tname (xargs .DaemonID ) ))
489+ actionDonef (c , "Started %s%s on %s." + add , apc .ActResilver , s , meta .Tname (xargs .DaemonID ))
485490 } else {
486- actionDone (c , fmt . Sprintf ( "Started %s%s simultaneously on all targets." + add , apc .ActResilver , s ) )
491+ actionDonef (c , "Started %s%s simultaneously on all targets." + add , apc .ActResilver , s )
487492 }
488493 default :
489494 actionX (c , xargs , "" )
@@ -792,9 +797,9 @@ func newHFDownloadJobDef(c *cli.Context, req *downloadRequest) (*HFDownloadJobDe
792797 }
793798
794799 if isDataset {
795- actionDone (c , fmt . Sprintf ( "Found %d parquet files in dataset '%s'" , len (files ), identifier ) )
800+ actionDonef (c , "Found %d parquet files in dataset '%s'" , len (files ), identifier )
796801 } else {
797- actionDone (c , fmt . Sprintf ( "Found %d files in model '%s'" , len (files ), identifier ) )
802+ actionDonef (c , "Found %d files in model '%s'" , len (files ), identifier )
798803 }
799804
800805 return & HFDownloadJobDef {
@@ -1034,7 +1039,7 @@ func singleJobProgress(c *cli.Context, id string) error {
10341039func checkJobCompletion (c * cli.Context , jobID string , completed map [string ]struct {}) {
10351040 resp , err := api .DownloadStatus (apiBP , jobID , false /*onlyActive*/ )
10361041 if err != nil {
1037- actionWarn (c , fmt . Sprintf ( "Failed to check status for job %s: %v" , jobID , err ) )
1042+ actionWarnf (c , "Failed to check status for job %s: %v" , jobID , err )
10381043 return
10391044 }
10401045
@@ -1177,7 +1182,7 @@ func stopJobHandler(c *cli.Context) error {
11771182 if warn != "" {
11781183 switch {
11791184 case xid != "" :
1180- actionWarn (c , fmt . Sprintf ( "ignoring %s in presence of %s argument ('%s')" , warn , jobIDArgument , xid ) )
1185+ actionWarnf (c , "ignoring %s in presence of %s argument ('%s')" , warn , jobIDArgument , xid )
11811186 case name == commandRebalance :
11821187 actionWarn (c , "global rebalance is _global_ - ignoring" + warn )
11831188 case regex != "" && name != cmdDownload && name != cmdDsort :
@@ -1292,7 +1297,7 @@ func stopJobHandler(c *cli.Context) error {
12921297 if err := xstop (& args ); err != nil {
12931298 return err
12941299 }
1295- actionDone (c , fmt . Sprintf ( "Stopped %s\n " , msg ) )
1300+ actionDonef (c , "Stopped %s\n " , msg )
12961301 return nil
12971302}
12981303
@@ -1308,7 +1313,7 @@ func stopXactionKindOrAll(c *cli.Context, xactKind, xname string, bck cmn.Bck) e
13081313 if xname != "" {
13091314 what = " '" + xname + "'"
13101315 }
1311- actionDone (c , fmt . Sprintf ( "No running%s jobs, nothing to do" , what ) )
1316+ actionDonef (c , "No running%s jobs, nothing to do" , what )
13121317 return nil
13131318 }
13141319 for _ , cname := range cnames {
@@ -1319,7 +1324,7 @@ func stopXactionKindOrAll(c *cli.Context, xactKind, xname string, bck cmn.Bck) e
13191324 }
13201325 args := xact.ArgsMsg {ID : xactID , Kind : xactKind , Bck : bck }
13211326 if err := xstop (& args ); err != nil {
1322- actionWarn (c , fmt . Sprintf ( "failed to stop %s: %v" , cname , err ) )
1327+ actionWarnf (c , "failed to stop %s: %v" , cname , err )
13231328 } else {
13241329 actionDone (c , "Stopped " + cname )
13251330 }
@@ -1357,7 +1362,7 @@ func stopDownloadRegex(c *cli.Context, regex string) error {
13571362 actionDone (c , "Stopped download job " + dl .ID )
13581363 cnt ++
13591364 } else {
1360- actionWarn (c , fmt . Sprintf ( "failed to stop download job %q: %v" , dl .ID , err ) )
1365+ actionWarnf (c , "failed to stop download job %q: %v" , dl .ID , err )
13611366 }
13621367 }
13631368 if err != nil {
@@ -1373,7 +1378,7 @@ func stopDownloadHandler(c *cli.Context, id string) (err error) {
13731378 if err = api .AbortDownload (apiBP , id ); err != nil {
13741379 return
13751380 }
1376- actionDone (c , fmt . Sprintf ( "Stopped download job %s\n " , id ) )
1381+ actionDonef (c , "Stopped download job %s\n " , id )
13771382 return
13781383}
13791384
@@ -1390,7 +1395,7 @@ func stopDsortRegex(c *cli.Context, regex string) error {
13901395 actionDone (c , "Stopped dsort job " + dsort .ID )
13911396 cnt ++
13921397 } else {
1393- actionWarn (c , fmt . Sprintf ( "failed to stop dsort job %q: %v" , dsort .ID , err ) )
1398+ actionWarnf (c , "failed to stop dsort job %q: %v" , dsort .ID , err )
13941399 }
13951400 }
13961401 if err != nil {
@@ -1406,7 +1411,7 @@ func stopDsortHandler(c *cli.Context, id string) (err error) {
14061411 if err = api .AbortDsort (apiBP , id ); err != nil {
14071412 return
14081413 }
1409- actionDone (c , fmt . Sprintf ( "Stopped dsort job %s\n " , id ) )
1414+ actionDonef (c , "Stopped dsort job %s\n " , id )
14101415 return
14111416}
14121417
@@ -1428,7 +1433,7 @@ func waitJobHandler(c *cli.Context) error {
14281433 return missingArgumentsError (c , c .Command .ArgsUsage )
14291434 }
14301435 if daemonID != "" {
1431- actionWarn (c , fmt . Sprintf ( "node ID %q will be ignored (waiting for a single target not supported)\n " , daemonID ) )
1436+ actionWarnf (c , "node ID %q will be ignored (waiting for a single target not supported)\n " , daemonID )
14321437 }
14331438
14341439 if name == "" && xid != "" {
@@ -1655,7 +1660,7 @@ func removeDownloadHandler(c *cli.Context) error {
16551660 if err := api .RemoveDownload (apiBP , id ); err != nil {
16561661 return V (err )
16571662 }
1658- actionDone (c , fmt . Sprintf ( "Removed finished download job %q" , id ) )
1663+ actionDonef (c , "Removed finished download job %q" , id )
16591664 return nil
16601665}
16611666
@@ -1672,10 +1677,10 @@ func removeDownloadRegex(c *cli.Context, regex string) error {
16721677 }
16731678 err = api .RemoveDownload (apiBP , dl .ID )
16741679 if err == nil {
1675- actionDone (c , fmt . Sprintf ( "Removed download job %q" , dl .ID ) )
1680+ actionDonef (c , "Removed download job %q" , dl .ID )
16761681 cnt ++
16771682 } else {
1678- actionWarn (c , fmt . Sprintf ( "failed to remove download job %q: %v" , dl .ID , err ) )
1683+ actionWarnf (c , "failed to remove download job %q: %v" , dl .ID , err )
16791684 }
16801685 }
16811686 if err != nil {
@@ -1705,7 +1710,7 @@ func removeDsortHandler(c *cli.Context) error {
17051710 return V (err )
17061711 }
17071712
1708- actionDone (c , fmt . Sprintf ( "Removed finished dsort job %q" , id ) )
1713+ actionDonef (c , "Removed finished dsort job %q" , id )
17091714 return nil
17101715}
17111716
@@ -1722,10 +1727,10 @@ func removeDsortRegex(c *cli.Context, regex string) error {
17221727 }
17231728 err = api .RemoveDsort (apiBP , dsort .ID )
17241729 if err == nil {
1725- actionDone (c , fmt . Sprintf ( "Removed dsort job %q" , dsort .ID ) )
1730+ actionDonef (c , "Removed dsort job %q" , dsort .ID )
17261731 cnt ++
17271732 } else {
1728- actionWarn (c , fmt . Sprintf ( "failed to remove dsort job %q: %v" , dsort .ID , err ) )
1733+ actionWarnf (c , "failed to remove dsort job %q: %v" , dsort .ID , err )
17291734 }
17301735 }
17311736 if err != nil {
0 commit comments