]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Pass empty string to clear mantle balancer
authorZhi Zhang <willzzhang@tencent.com>
Thu, 25 May 2017 08:05:31 +0000 (16:05 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Fri, 26 May 2017 06:54:32 +0000 (14:54 +0800)
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/mon/FSCommands.cc
src/pybind/ceph_argparse.py

index 630736c398990672880d5b1de126b65bcabd6c39..0ef7c8a2d43a8e480e764d45a077003c30a07f2c 100644 (file)
@@ -295,7 +295,10 @@ public:
         });
       }
     } else if (var == "balancer") {
-      ss << "setting the metadata load balancer to " << val;
+      if (val.empty())
+        ss << "unsetting the metadata load balancer";
+      else 
+        ss << "setting the metadata load balancer to " << val;
         fsmap.modify_filesystem(
             fs->fscid,
             [val](std::shared_ptr<Filesystem> fs)
index 9328b6c47d871306995d80990bb27dce11d136a2..f188d8f236ac3ebf648c2d7ad2f20e6d3c3acb01 100644 (file)
@@ -920,12 +920,12 @@ def validate(args, signature, flags=0, partial=False):
 
             # no arg, but not required?  Continue consuming mysig
             # in case there are later required args
-            if not myarg and not desc.req:
+            if myarg == None and not desc.req:
                 break
 
             # out of arguments for a required param?
             # Either return (if partial validation) or raise
-            if not myarg and desc.req:
+            if myarg == None and desc.req:
                 if desc.N and desc.numseen < 1:
                     # wanted N, didn't even get 1
                     if partial: