aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorchrislu <chrislu@roblox.com>2021-12-10 13:24:38 -0800
committerchrislu <chrislu@roblox.com>2021-12-10 13:24:38 -0800
commita2d3f89c7b136780f0ca0400dec3c93c9370df8c (patch)
treeb7a5037df534122cff459c3902a38c270348d3f5 /weed/shell
parent991a3dca0d30e980a234c8d8e4c5558625b03325 (diff)
downloadseaweedfs-a2d3f89c7b136780f0ca0400dec3c93c9370df8c.tar.xz
seaweedfs-a2d3f89c7b136780f0ca0400dec3c93c9370df8c.zip
add lock messages
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_collection_delete.go2
-rw-r--r--weed/shell/command_ec_balance.go2
-rw-r--r--weed/shell/command_ec_decode.go2
-rw-r--r--weed/shell/command_ec_encode.go2
-rw-r--r--weed/shell/command_ec_rebuild.go2
-rw-r--r--weed/shell/command_volume_balance.go2
-rw-r--r--weed/shell/command_volume_check_disk.go2
-rw-r--r--weed/shell/command_volume_configure_replication.go2
-rw-r--r--weed/shell/command_volume_copy.go2
-rw-r--r--weed/shell/command_volume_delete.go2
-rw-r--r--weed/shell/command_volume_delete_empty.go2
-rw-r--r--weed/shell/command_volume_fix_replication.go2
-rw-r--r--weed/shell/command_volume_fsck.go2
-rw-r--r--weed/shell/command_volume_mark.go2
-rw-r--r--weed/shell/command_volume_mount.go2
-rw-r--r--weed/shell/command_volume_move.go2
-rw-r--r--weed/shell/command_volume_server_evacuate.go2
-rw-r--r--weed/shell/command_volume_server_leave.go2
-rw-r--r--weed/shell/command_volume_tier_download.go2
-rw-r--r--weed/shell/command_volume_tier_move.go2
-rw-r--r--weed/shell/command_volume_tier_upload.go2
-rw-r--r--weed/shell/command_volume_unmount.go2
-rw-r--r--weed/shell/command_volume_vacuum.go2
-rw-r--r--weed/shell/commands.go3
24 files changed, 25 insertions, 24 deletions
diff --git a/weed/shell/command_collection_delete.go b/weed/shell/command_collection_delete.go
index da79b3437..8942c15da 100644
--- a/weed/shell/command_collection_delete.go
+++ b/weed/shell/command_collection_delete.go
@@ -36,7 +36,7 @@ func (c *commandCollectionDelete) Do(args []string, commandEnv *CommandEnv, writ
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index e5438b9c7..6cd91119b 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -108,7 +108,7 @@ func (c *commandEcBalance) Do(args []string, commandEnv *CommandEnv, writer io.W
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index c9f49745b..b2ca605c7 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -46,7 +46,7 @@ func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index 3606f42e3..6add14749 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -66,7 +66,7 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_ec_rebuild.go b/weed/shell/command_ec_rebuild.go
index c3f72ea91..409ec4329 100644
--- a/weed/shell/command_ec_rebuild.go
+++ b/weed/shell/command_ec_rebuild.go
@@ -64,7 +64,7 @@ func (c *commandEcRebuild) Do(args []string, commandEnv *CommandEnv, writer io.W
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index 72c4c6db5..4c55de5fb 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -71,7 +71,7 @@ func (c *commandVolumeBalance) Do(args []string, commandEnv *CommandEnv, writer
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index 4488badbb..643cccac3 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -51,7 +51,7 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_configure_replication.go b/weed/shell/command_volume_configure_replication.go
index 7e9627b40..27cba618b 100644
--- a/weed/shell/command_volume_configure_replication.go
+++ b/weed/shell/command_volume_configure_replication.go
@@ -45,7 +45,7 @@ func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *Comman
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_copy.go b/weed/shell/command_volume_copy.go
index b4dfbb78a..0a4ac5063 100644
--- a/weed/shell/command_volume_copy.go
+++ b/weed/shell/command_volume_copy.go
@@ -41,7 +41,7 @@ func (c *commandVolumeCopy) Do(args []string, commandEnv *CommandEnv, writer io.
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_delete.go b/weed/shell/command_volume_delete.go
index 135ad7285..30d71ba9f 100644
--- a/weed/shell/command_volume_delete.go
+++ b/weed/shell/command_volume_delete.go
@@ -38,7 +38,7 @@ func (c *commandVolumeDelete) Do(args []string, commandEnv *CommandEnv, writer i
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_delete_empty.go b/weed/shell/command_volume_delete_empty.go
index fdc4fcf6a..c98693147 100644
--- a/weed/shell/command_volume_delete_empty.go
+++ b/weed/shell/command_volume_delete_empty.go
@@ -40,7 +40,7 @@ func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, wri
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index 4a4ed5f9f..2885ba11f 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -64,7 +64,7 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv,
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index bd5241173..5f6ddd7c3 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -66,7 +66,7 @@ func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_mark.go b/weed/shell/command_volume_mark.go
index 7734ea9ce..53c2265b0 100644
--- a/weed/shell/command_volume_mark.go
+++ b/weed/shell/command_volume_mark.go
@@ -44,7 +44,7 @@ func (c *commandVolumeMark) Do(args []string, commandEnv *CommandEnv, writer io.
markWritable = true
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_mount.go b/weed/shell/command_volume_mount.go
index 385e43341..575051ffe 100644
--- a/weed/shell/command_volume_mount.go
+++ b/weed/shell/command_volume_mount.go
@@ -42,7 +42,7 @@ func (c *commandVolumeMount) Do(args []string, commandEnv *CommandEnv, writer io
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_move.go b/weed/shell/command_volume_move.go
index ec71ba2b3..796f74264 100644
--- a/weed/shell/command_volume_move.go
+++ b/weed/shell/command_volume_move.go
@@ -59,7 +59,7 @@ func (c *commandVolumeMove) Do(args []string, commandEnv *CommandEnv, writer io.
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go
index 691d6d552..6a8aeab52 100644
--- a/weed/shell/command_volume_server_evacuate.go
+++ b/weed/shell/command_volume_server_evacuate.go
@@ -53,7 +53,7 @@ func (c *commandVolumeServerEvacuate) Do(args []string, commandEnv *CommandEnv,
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_server_leave.go b/weed/shell/command_volume_server_leave.go
index b1c42f4fd..4daa589be 100644
--- a/weed/shell/command_volume_server_leave.go
+++ b/weed/shell/command_volume_server_leave.go
@@ -43,7 +43,7 @@ func (c *commandVolumeServerLeave) Do(args []string, commandEnv *CommandEnv, wri
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_tier_download.go b/weed/shell/command_volume_tier_download.go
index 72331c8ce..57d3bf347 100644
--- a/weed/shell/command_volume_tier_download.go
+++ b/weed/shell/command_volume_tier_download.go
@@ -50,7 +50,7 @@ func (c *commandVolumeTierDownload) Do(args []string, commandEnv *CommandEnv, wr
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go
index 348f1799a..bdd90e196 100644
--- a/weed/shell/command_volume_tier_move.go
+++ b/weed/shell/command_volume_tier_move.go
@@ -57,7 +57,7 @@ func (c *commandVolumeTierMove) Do(args []string, commandEnv *CommandEnv, writer
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go
index 72f5347b0..a22fe92a1 100644
--- a/weed/shell/command_volume_tier_upload.go
+++ b/weed/shell/command_volume_tier_upload.go
@@ -68,7 +68,7 @@ func (c *commandVolumeTierUpload) Do(args []string, commandEnv *CommandEnv, writ
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_unmount.go b/weed/shell/command_volume_unmount.go
index 065cbf227..d5cb9f07c 100644
--- a/weed/shell/command_volume_unmount.go
+++ b/weed/shell/command_volume_unmount.go
@@ -42,7 +42,7 @@ func (c *commandVolumeUnmount) Do(args []string, commandEnv *CommandEnv, writer
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/command_volume_vacuum.go b/weed/shell/command_volume_vacuum.go
index ecd4d7756..2e09a8c1b 100644
--- a/weed/shell/command_volume_vacuum.go
+++ b/weed/shell/command_volume_vacuum.go
@@ -35,7 +35,7 @@ func (c *commandVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writ
return nil
}
- if err = commandEnv.confirmIsLocked(); err != nil {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
return
}
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 6b614c159..02c0af59e 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -70,11 +70,12 @@ func (ce *CommandEnv) isDirectory(path string) bool {
}
-func (ce *CommandEnv) confirmIsLocked() error {
+func (ce *CommandEnv) confirmIsLocked(args []string) error {
if ce.locker.IsLocking() {
return nil
}
+ ce.locker.SetMessage(fmt.Sprintf("%v", args))
return fmt.Errorf("need to run \"lock\" first to continue")