@@ -13,7 +13,7 @@ import (
1313const (
1414 flagPort = "port"
1515 flagAuthorizationToken = "authorization-token"
16- flagDisks = "disks"
16+ flagMonitorDisks = "monitor- disks"
1717 flagDebug = "debug"
1818
1919 flagBrand = "brand"
@@ -53,7 +53,7 @@ func GetStartWebCmd() *cobra.Command {
5353 nodeHomeDirectory := strings .TrimSpace (args [0 ])
5454 port , _ := cmd .Flags ().GetUint16 (flagPort )
5555 authorizationToken , _ := cmd .Flags ().GetString (flagAuthorizationToken )
56- disks , _ := cmd .Flags ().GetStringSlice (flagDisks )
56+ monitorDisks , _ := cmd .Flags ().GetStringSlice (flagMonitorDisks )
5757 debug , _ := cmd .Flags ().GetBool (flagDebug )
5858
5959 brand , _ := cmd .Flags ().GetString (flagBrand )
@@ -84,31 +84,35 @@ func GetStartWebCmd() *cobra.Command {
8484 return
8585 }
8686
87- if disks == nil || len (disks ) == 0 {
88- utils .ExitWithErrorMsgf ("ERR: disks is required, use --%s flag to set it\n " , flagDisks )
87+ if monitorDisks == nil || len (monitorDisks ) == 0 {
88+ utils .ExitWithErrorMsgf ("ERR: disks are required, use --%s flag to set it\n " , flagMonitorDisks )
8989 return
9090 }
91- for _ , disk := range disks {
92- disk := strings .TrimSpace (disk )
93- if ! strings .HasPrefix (disk , "/" ) {
94- utils .ExitWithErrorMsgf ("ERR: disk must be absolute path, correct the --%s flag\n " , flagDisks )
91+ for _ , disk := range monitorDisks {
92+ monitorDisk := strings .TrimSpace (disk )
93+ if ! strings .HasPrefix (monitorDisk , "/" ) {
94+ utils .ExitWithErrorMsgf ("ERR: disk must be absolute path, correct the --%s flag\n " , flagMonitorDisks )
9595 return
9696 }
97- if strings .HasPrefix (disk , "/dev" ) {
98- utils .ExitWithErrorMsgf ("ERR: disk must be path, not device, correct the --%s flag\n " , flagDisks )
97+ if strings .HasPrefix (monitorDisk , "/dev" ) {
98+ utils .ExitWithErrorMsgf ("ERR: disk must be filesystem path, not device, correct the --%s flag\n " , flagMonitorDisks )
9999 return
100100 }
101- _ , exists , isDir , err := utils .FileInfo (disk )
101+ _ , exists , isDir , err := utils .FileInfo (monitorDisk )
102102 if err != nil {
103- utils .ExitWithErrorMsgf ("ERR: disk %s is invalid, correct the --%s flag\n " , disk , flagDisks )
103+ utils .ExitWithErrorMsgf ("ERR: disk %s is invalid, correct the --%s flag\n " , monitorDisk , flagMonitorDisks )
104104 return
105105 }
106106 if ! exists {
107- utils .ExitWithErrorMsgf ("ERR: disk %s does not exists, correct the --%s flag\n " , disk , flagDisks )
107+ utils .ExitWithErrorMsgf ("ERR: disk %s does not exists, correct the --%s flag\n " , monitorDisk , flagMonitorDisks )
108108 return
109109 }
110110 if ! isDir {
111- utils .ExitWithErrorMsgf ("ERR: disk %s is not a directory, correct the --%s flag\n " , disk , flagDisks )
111+ utils .ExitWithErrorMsgf (
112+ "ERR: disk %s is not a directory, must be filesystem path, correct the --%s flag\n " ,
113+ monitorDisk ,
114+ flagMonitorDisks ,
115+ )
112116 return
113117 }
114118 }
@@ -201,7 +205,7 @@ func GetStartWebCmd() *cobra.Command {
201205 web_server .StartWebServer (webtypes.Config {
202206 Port : port ,
203207 AuthorizeToken : authorizationToken ,
204- Disks : disks ,
208+ MonitorDisks : monitorDisks ,
205209 NodeHome : nodeHomeDirectory ,
206210 Debug : debug ,
207211
@@ -227,7 +231,7 @@ func GetStartWebCmd() *cobra.Command {
227231
228232 cmd .Flags ().Uint16 (flagPort , defaultWebPort , "port to bind Web service to" )
229233 cmd .Flags ().StringP (flagAuthorizationToken , "a" , "" , "authorization token" )
230- cmd .Flags ().StringSlice (flagDisks , []string {"/" }, "disks to monitor, must be path, mount-point, not device" )
234+ cmd .Flags ().StringSlice (flagMonitorDisks , []string {"/" }, "disks to monitor, must be path, mount-point, not device" )
231235 cmd .Flags ().Bool (flagDebug , false , "enable debug mode" )
232236
233237 cmd .Flags ().String (flagBrand , defaultBrand , "brand" )
0 commit comments