]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Don't use -i to set id for non-daemons
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Mar 2011 15:41:50 +0000 (07:41 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 10 Mar 2011 15:49:03 +0000 (07:49 -0800)
Due to conflicts, don't use -i to set id except for daemons.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/cconf.cc
src/ceph_common.sh
src/common/ceph_argparse.cc
src/test/cli/cauthtool/manpage.t
src/test/cli/cconf/help.t
src/test/cli/cconf/invalid-args.t
src/test/cli/cconf/simple.t

index 9370cde389d1c8305e2e52db48b2c97a54071746..bf0857114c58fd2eecdd1020f735c66cb3c6f69c 100644 (file)
@@ -44,13 +44,13 @@ ACTIONS\n\
                                   delimited search list.\n\
 \n\
 FLAGS\n\
-  -i id                           Set id\n\
+  --name name                     Set type.id\n\
   [-s <section>]                  Add to list of sections to search\n\
 \n\
 If there is no action given, the action will default to --lookup.\n\
 \n\
 EXAMPLES\n\
-$ cconf -cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr'\n\
+$ cconf --name client.cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr'\n\
 Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf\n\
 \n\
 $ cconf -l mon\n\
index 99c6e8f54560d52075cfecd42fa414cb2ccfef59..36f1cdd90a8ef5146c21e23fa227465fdaadff36 100644 (file)
@@ -45,7 +45,7 @@ verify_conf() {
 
 check_host() {
     # what host is this daemon assigned to?
-    host=`$CCONF -c $conf -i $id -t $type host`
+    host=`$CCONF -c $conf --name $type.$id host`
     [ "$host" = "localhost" ] && host=""
     ssh=""
     rootssh=""
@@ -146,8 +146,8 @@ get_conf() {
        key=$3
        shift; shift; shift
 
-       [ "$verbose" -eq 1 ] && echo "$CCONF -c $conf -i $id -t $type \"$key\""
-       eval "$var=\"`$CCONF -c $conf -i $id -t $type \"$key\" || eval echo -n \"$def\"`\""
+       [ "$verbose" -eq 1 ] && echo "$CCONF -c $conf --name $type.$id \"$key\""
+       eval "$var=\"`$CCONF -c $conf --name $type.$id \"$key\" || eval echo -n \"$def\"`\""
 }
 
 get_conf_bool() {
index 37205edffce624fc41af9b3ea87b7789ad639d58..ee454e8af25e4849d5057507c25d579332723229 100644 (file)
@@ -250,7 +250,11 @@ CephInitParameters ceph_argparse_early_args
     else if (ceph_argparse_witharg(args, i, &val, "--conf", "-c", NULL)) {
       iparams.conf_file = val;
     }
-    else if (ceph_argparse_witharg(args, i, &val, "-i", "--id", NULL)) {
+    else if ((module_type != CEPH_ENTITY_TYPE_CLIENT) &&
+            (ceph_argparse_witharg(args, i, &val, "-i", NULL))) {
+      iparams.name.set_id(val);
+    }
+    else if (ceph_argparse_witharg(args, i, &val, "--id", NULL)) {
       iparams.name.set_id(val);
     }
     else if (ceph_argparse_witharg(args, i, &val, "--name", "-n", NULL)) {
index d1530bd1ce5f0d18f478529e9a737ac0bec54064..b5e79d8fe2da1d6b72a75afcd13486cb4c4694b2 100644 (file)
@@ -5,7 +5,7 @@
 
 # demonstrate that manpage examples fail without config
 # TODO fix the manpage
-  $ cauthtool --create-keyring -foo --gen-key keyring
+  $ cauthtool --create-keyring --name client.foo --gen-key keyring
   creating keyring
 
 # work around the above
@@ -13,7 +13,7 @@
 
 To create a new keyring containing a key for client.foo:
 
-  $ cauthtool --create-keyring -i foo --gen-key keyring.bin
+  $ cauthtool --create-keyring --id foo --gen-key keyring.bin
   creating keyring.bin
 
   $ cauthtool --create-keyring --name client.foo --gen-key keyring.bin
index dec7383e04dd56a923546165dd3ab89a95c029dd..39686076559379923b96741af419774b4f00b236 100644 (file)
                                     delimited search list.
   
   FLAGS
-    -i id                           Set id
+    --name name                     Set type.id
     [-s <section>]                  Add to list of sections to search
   
   If there is no action given, the action will default to --lookup.
   
   EXAMPLES
-  [$] cconf -i cconf -c /etc/ceph/ceph\.conf -t mon -i 0 'mon addr' (re)
+  [$] cconf --name client.cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re)
   Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf
   
   [$] cconf -l mon (re)
index c07814d5d11a9eac539f9a3d2dbec35a8e3ef983..eeff0944077f9576e31a098614e019634993c692 100644 (file)
                                     delimited search list.
   
   FLAGS
-    -i id                           Set id
+    --name name                     Set type.id
     [-s <section>]                  Add to list of sections to search
   
   If there is no action given, the action will default to --lookup.
   
   EXAMPLES
-  [$] cconf -cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re)
+  [$] cconf --name client.cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re)
   Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf
   
   [$] cconf -l mon (re)
index 58654a78d7912d943d4d6c5d3ddfd0787f05a7e4..591129a852cc523c0e7a129c9b5a5f39aba4a459 100644 (file)
                                     delimited search list.
   
   FLAGS
-    -i id                           Set id
+    --name name                     Set type.id
     [-s <section>]                  Add to list of sections to search
   
   If there is no action given, the action will default to --lookup.
   
   EXAMPLES
-  [$] cconf -cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re)
+  [$] cconf --name client.cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re)
   Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf
   
   [$] cconf -l mon (re)