]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove format argument from osd crush dump 1234/head
authorLoic Dachary <loic@dachary.org>
Thu, 13 Feb 2014 15:20:51 +0000 (16:20 +0100)
committerLoic Dachary <loic@dachary.org>
Thu, 13 Feb 2014 15:27:42 +0000 (16:27 +0100)
The --format argument of the ceph cli is used to send the desired format
argument. The format argument is always part of the command sent to the
server. Adding it to the command description in MonCommand is not
necessary.

partially revert cec1893310005eca29186145de66391789211e70
revert fce4d6840448053b685ca3407b2a2680109d6df2

Signed-off-by: Loic Dachary <loic@dachary.org>
src/mon/MonCommands.h
src/test/mon/osd-crush.sh
src/test/pybind/test_ceph_argparse.py

index 31478dd6b3d5fa0c5645c584b5009b9367223389..a4acd09b64082ec1503891e24b1fc398cf50b463 100644 (file)
@@ -364,13 +364,11 @@ COMMAND("osd blacklist ls", "show blacklisted clients", "osd", "r", "cli,rest")
 COMMAND("osd crush rule list", "list crush rules", "osd", "r", "cli,rest")
 COMMAND("osd crush rule ls", "list crush rules", "osd", "r", "cli,rest")
 COMMAND("osd crush rule dump " \
-       "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false " \
-       "name=format,type=CephChoices,strings=json|json-pretty|xml|xml-pretty,req=false", \
-       "dump crush rule <name> (default all) formatted as <format> (default json-pretty)", \
+       "name=name,type=CephString,goodchars=[A-Za-z0-9-_.],req=false", \
+       "dump crush rule <name> (default all)", \
        "osd", "r", "cli,rest")
-COMMAND("osd crush dump " \
-       "name=format,type=CephChoices,strings=json|json-pretty|xml|xml-pretty,req=false", \
-       "dump crush map formatted as <format> (default json-pretty)", \
+COMMAND("osd crush dump", \
+       "dump crush map", \
        "osd", "r", "cli,rest")
 COMMAND("osd setcrushmap", "set crush map from input file", \
        "osd", "rw", "cli,rest")
index e826f393fcc45ac373835f1ca82314ad555b69c0..efe7fa52864ad2ccc134c4d9af27e42861e41dc2 100755 (executable)
@@ -37,7 +37,7 @@ function run() {
 
 function TEST_crush_rule_create_simple() {
     local dir=$1
-    ./ceph osd crush rule dump replicated_ruleset xml | \
+    ./ceph --format xml osd crush rule dump replicated_ruleset | \
         grep '<op>take</op><item>default</item>' | \
         grep '<op>chooseleaf_firstn</op><num>0</num><type>host</type>' || return 1
     local ruleset=ruleset0
@@ -47,7 +47,7 @@ function TEST_crush_rule_create_simple() {
     ./ceph osd crush rule create-simple $ruleset $root $failure_domain || return 1
     ./ceph osd crush rule create-simple $ruleset $root $failure_domain 2>&1 | \
         grep "$ruleset already exists" || return 1
-    ./ceph osd crush rule dump $ruleset xml | \
+    ./ceph --format xml osd crush rule dump $ruleset | \
         grep '<op>take</op><item>'$root'</item>' | \
         grep '<op>choose_firstn</op><num>0</num><type>'$failure_domain'</type>' || return 1
     ./ceph osd crush rule rm $ruleset || return 1
@@ -59,12 +59,8 @@ function TEST_crush_rule_dump() {
     ./ceph osd crush rule create-erasure $ruleset || return 1
     local expected
     expected="<rule_name>$ruleset</rule_name>"
-    ./ceph osd crush rule dump $ruleset xml | grep $expected || return 1
-    ./ceph osd crush rule dump $ruleset xml-pretty | grep $expected || return 1
-    expected='"rule_name":"'$ruleset'"'
-    ./ceph osd crush rule dump $ruleset json | grep "$expected" || return 1
+    ./ceph --format xml osd crush rule dump $ruleset | grep $expected || return 1
     expected='"rule_name": "'$ruleset'"'
-    ./ceph osd crush rule dump $ruleset json-pretty | grep "$expected" || return 1
     ./ceph osd crush rule dump | grep "$expected" || return 1
     ! ./ceph osd crush rule dump non_existent_ruleset || return 1
     ./ceph osd crush rule rm $ruleset || return 1
index c1362aea8388344059350d6f75086b66a298dc14..f26a854363125b9ceaf5e856ec742defb311ddea 100755 (executable)
@@ -577,21 +577,16 @@ class TestOSD(TestArgparse):
     def test_crush_rule_dump(self):
         self.assert_valid_command(['osd', 'crush', 'rule', 'dump'])
         self.assert_valid_command(['osd', 'crush', 'rule', 'dump', 'RULE'])
-        for format in ('json', 'json-pretty', 'xml', 'xml-pretty'):
-            self.assert_valid_command(['osd', 'crush', 'rule',
-                                       'dump', 'RULE', format])
         assert_equal({}, validate_command(sigdict, ['osd', 'crush',
                                                     'rule', 'dump',
-                                                    'RULE', 'json',
+                                                    'RULE',
                                                     'toomany']))
 
     def test_crush_dump(self):
         self.assert_valid_command(['osd', 'crush', 'dump'])
-        for format in ('json', 'json-pretty', 'xml', 'xml-pretty'):
-                       self.assert_valid_command(['osd', 'crush', 'dump', format])
         assert_equal({}, validate_command(sigdict, ['osd', 'crush']))
         assert_equal({}, validate_command(sigdict, ['osd', 'crush',
-                                                    'dump', 'json',
+                                                    'dump', 
                                                     'toomany']))
 
     def test_setcrushmap(self):