From 572a942f8f61f02dd0fe456d14800ec446de5e9d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 19 Jul 2017 12:33:14 -0400 Subject: [PATCH] mon: 'auth list' -> 'auth ls' Signed-off-by: Sage Weil --- doc/man/8/ceph-create-keys.rst | 2 +- doc/man/8/ceph-rest-api.rst | 2 +- doc/man/8/ceph.rst | 4 ++-- doc/rados/operations/control.rst | 2 +- doc/rados/operations/pools.rst | 2 +- doc/rados/operations/user-management.rst | 6 +++--- doc/rbd/libvirt.rst | 2 +- doc/release-notes.rst | 1 + qa/tasks/cephfs/cephfs_test_case.py | 4 ++-- qa/workunits/cephtool/test.sh | 13 +++++++------ qa/workunits/mon/auth_caps.sh | 2 +- qa/workunits/mon/caps.py | 2 +- qa/workunits/mon/caps.sh | 8 ++++---- src/mon/AuthMonitor.cc | 3 ++- src/mon/MonCommands.h | 4 +++- 15 files changed, 31 insertions(+), 26 deletions(-) diff --git a/doc/man/8/ceph-create-keys.rst b/doc/man/8/ceph-create-keys.rst index 0827a0a62fc..20b6560b241 100644 --- a/doc/man/8/ceph-create-keys.rst +++ b/doc/man/8/ceph-create-keys.rst @@ -30,7 +30,7 @@ It creates following auth entities (or users) To list all users in the cluster:: - ceph auth list + ceph auth ls Options diff --git a/doc/man/8/ceph-rest-api.rst b/doc/man/8/ceph-rest-api.rst index f9eb3d4323d..9864a9b6f56 100644 --- a/doc/man/8/ceph-rest-api.rst +++ b/doc/man/8/ceph-rest-api.rst @@ -47,7 +47,7 @@ Options specifies the client 'name', which is used to find the client-specific configuration options in the config file, and also is the name used for authentication when connecting - to the cluster (the entity name appearing in ceph auth list output, + to the cluster (the entity name appearing in 'ceph auth ls' output, for example). The default is 'client.restapi'. .. option:: -i/--id id diff --git a/doc/man/8/ceph.rst b/doc/man/8/ceph.rst index 7682603ac34..712d862f729 100644 --- a/doc/man/8/ceph.rst +++ b/doc/man/8/ceph.rst @@ -143,11 +143,11 @@ Usage:: ceph auth import -Subcommand ``list`` lists authentication state. +Subcommand ``ls`` lists authentication state. Usage:: - ceph auth list + ceph auth ls Subcommand ``print-key`` displays requested key. diff --git a/doc/rados/operations/control.rst b/doc/rados/operations/control.rst index bd43587568b..b2fe355bf48 100644 --- a/doc/rados/operations/control.rst +++ b/doc/rados/operations/control.rst @@ -50,7 +50,7 @@ To add a keyring for an OSD, execute the following:: To list the cluster's keys and their capabilities, execute the following:: - ceph auth list + ceph auth ls Placement Group Subsystem diff --git a/doc/rados/operations/pools.rst b/doc/rados/operations/pools.rst index b93631d8ca8..c5ebe09720a 100644 --- a/doc/rados/operations/pools.rst +++ b/doc/rados/operations/pools.rst @@ -198,7 +198,7 @@ ruleset from the cluster. If you created users with permissions strictly for a pool that no longer exists, you should consider deleting those users too:: - ceph auth list | grep -C 5 {pool-name} + ceph auth ls | grep -C 5 {pool-name} ceph auth del {user} diff --git a/doc/rados/operations/user-management.rst b/doc/rados/operations/user-management.rst index efd92f730a9..6f12e7f427a 100644 --- a/doc/rados/operations/user-management.rst +++ b/doc/rados/operations/user-management.rst @@ -251,10 +251,10 @@ List Users To list the users in your cluster, execute the following:: - ceph auth list + ceph auth ls Ceph will list out all users in your cluster. For example, in a two-node -exemplary cluster, ``ceph auth list`` will output something that looks like +exemplary cluster, ``ceph auth ls`` will output something that looks like this:: installed auth entries: @@ -286,7 +286,7 @@ user of type ``osd`` and its ID is ``0``, ``client.admin`` is a user of type Note also that each entry has a ``key: `` entry, and one or more ``caps:`` entries. -You may use the ``-o {filename}`` option with ``ceph auth list`` to +You may use the ``-o {filename}`` option with ``ceph auth ls`` to save the output to a file. diff --git a/doc/rbd/libvirt.rst b/doc/rbd/libvirt.rst index b0a3dbda3c7..858843c4b5c 100644 --- a/doc/rbd/libvirt.rst +++ b/doc/rbd/libvirt.rst @@ -75,7 +75,7 @@ To configure Ceph for use with ``libvirt``, perform the following steps: Verify the name exists. :: - ceph auth list + ceph auth ls **NOTE**: ``libvirt`` will access Ceph using the ID ``libvirt``, not the Ceph name ``client.libvirt``. See `User Management - User`_ and diff --git a/doc/release-notes.rst b/doc/release-notes.rst index cc1f749694f..80143f09de0 100644 --- a/doc/release-notes.rst +++ b/doc/release-notes.rst @@ -217,6 +217,7 @@ Major Changes from Kraken contents. (The existing ``ceph config-key list`` only dumps the key names, not the values.) - ``ceph config-key list`` is deprecated in favor of ``ceph config-key ls``. + - ``ceph auth list`` is deprecated in favor of ``ceph auth ls``. - ``ceph osd set-{full,nearfull,backfillfull}-ratio`` sets the cluster-wide ratio for various full thresholds (when the cluster refuses IO, when the cluster warns about being close to full, diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index 29ad941ea5b..1181c80048f 100644 --- a/qa/tasks/cephfs/cephfs_test_case.py +++ b/qa/tasks/cephfs/cephfs_test_case.py @@ -184,10 +184,10 @@ class CephFSTestCase(CephTestCase): def auth_list(self): """ - Convenience wrapper on "ceph auth list" + Convenience wrapper on "ceph auth ls" """ return json.loads(self.mds_cluster.mon_manager.raw_cluster_cmd( - "auth", "list", "--format=json-pretty" + "auth", "ls", "--format=json-pretty" ))['auth_dump'] def assert_session_count(self, expected, ls_data=None, mds_id=None): diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 9586d81c0df..d70ad533aaa 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -537,6 +537,7 @@ function test_auth() ceph auth add client.xx -i client.xx.keyring rm -f client.xx.keyring ceph auth list | grep client.xx + ceph auth ls | grep client.xx ceph auth get client.xx | grep caps | grep mon ceph auth get client.xx | grep caps | grep osd ceph auth get-key client.xx @@ -575,9 +576,9 @@ function test_auth() check_response "auid = $auid" ceph --format json-pretty auth get client.TEST > $TMPFILE check_response '"auid": '$auid - ceph auth list > $TMPFILE + ceph auth ls > $TMPFILE check_response "auid: $auid" - ceph --format json-pretty auth list > $TMPFILE + ceph --format json-pretty auth ls > $TMPFILE check_response '"auid": '$auid ceph auth del client.TEST } @@ -603,7 +604,7 @@ function test_auth_profiles() check_response "EACCES: access denied" ceph -n client.xx-profile-ro -k client.xx.keyring osd set noout >& $TMPFILE || true check_response "EACCES: access denied" - ceph -n client.xx-profile-ro -k client.xx.keyring auth list >& $TMPFILE || true + ceph -n client.xx-profile-ro -k client.xx.keyring auth ls >& $TMPFILE || true check_response "EACCES: access denied" # read-write is allowed for all read-write commands (except auth) @@ -616,11 +617,11 @@ function test_auth_profiles() ceph -n client.xx-profile-rw -k client.xx.keyring osd set noout ceph -n client.xx-profile-rw -k client.xx.keyring osd unset noout # read-write gets access denied for auth commands - ceph -n client.xx-profile-rw -k client.xx.keyring auth list >& $TMPFILE || true + ceph -n client.xx-profile-rw -k client.xx.keyring auth ls >& $TMPFILE || true check_response "EACCES: access denied" # role-definer is allowed RWX 'auth' commands and read-only 'mon' commands - ceph -n client.xx-profile-rd -k client.xx.keyring auth list + ceph -n client.xx-profile-rd -k client.xx.keyring auth ls ceph -n client.xx-profile-rd -k client.xx.keyring auth export ceph -n client.xx-profile-rd -k client.xx.keyring auth add client.xx-profile-foo ceph -n client.xx-profile-rd -k client.xx.keyring status @@ -795,7 +796,7 @@ function remove_all_fs() # in the cluster at all function mds_exists() { - ceph auth list | grep "^mds" + ceph auth ls | grep "^mds" } # some of the commands are just not idempotent. diff --git a/qa/workunits/mon/auth_caps.sh b/qa/workunits/mon/auth_caps.sh index 6c282c4b762..b8c10947424 100755 --- a/qa/workunits/mon/auth_caps.sh +++ b/qa/workunits/mon/auth_caps.sh @@ -68,7 +68,7 @@ read_ops() { expect $ret ceph auth get-key client.admin $args expect $ret ceph auth export $args expect $ret ceph auth export client.admin $args - expect $ret ceph auth list $args + expect $ret ceph auth ls $args expect $ret ceph auth print-key client.admin $args expect $ret ceph auth print_key client.admin $args } diff --git a/qa/workunits/mon/caps.py b/qa/workunits/mon/caps.py index 96dbf73ffd5..f1d0850f36c 100644 --- a/qa/workunits/mon/caps.py +++ b/qa/workunits/mon/caps.py @@ -220,7 +220,7 @@ def test_all(): 'auth':[ { 'pre':'', - 'cmd':('auth list', '', 'r'), + 'cmd':('auth ls', '', 'r'), 'post':'' }, { diff --git a/qa/workunits/mon/caps.sh b/qa/workunits/mon/caps.sh index f5aebbbb9f4..e00247d9c9b 100755 --- a/qa/workunits/mon/caps.sh +++ b/qa/workunits/mon/caps.sh @@ -28,10 +28,10 @@ expect "ceph auth get-or-create client.bazar > $tmp.bazar.keyring" 0 expect "ceph -k $tmp.bazar.keyring --user bazar mon_status" 13 ceph auth del client.bazar -c="'allow command \"auth list\", allow command mon_status'" +c="'allow command \"auth ls\", allow command mon_status'" expect "ceph auth get-or-create client.foo mon $c > $tmp.foo.keyring" 0 expect "ceph -k $tmp.foo.keyring --user foo mon_status" 0 -expect "ceph -k $tmp.foo.keyring --user foo auth list" 0 +expect "ceph -k $tmp.foo.keyring --user foo auth ls" 0 expect "ceph -k $tmp.foo.keyring --user foo auth export" 13 expect "ceph -k $tmp.foo.keyring --user foo auth del client.bazar" 13 expect "ceph -k $tmp.foo.keyring --user foo osd dump" 13 @@ -42,7 +42,7 @@ ceph auth del client.foo c="'allow command service with prefix=list, allow command mon_status'" expect "ceph auth get-or-create client.bar mon $c > $tmp.bar.keyring" 0 expect "ceph -k $tmp.bar.keyring --user bar mon_status" 0 -expect "ceph -k $tmp.bar.keyring --user bar auth list" 13 +expect "ceph -k $tmp.bar.keyring --user bar auth ls" 13 expect "ceph -k $tmp.bar.keyring --user bar auth export" 13 expect "ceph -k $tmp.bar.keyring --user bar auth del client.foo" 13 expect "ceph -k $tmp.bar.keyring --user bar osd dump" 13 @@ -52,4 +52,4 @@ ceph auth del client.bar rm $tmp.bazar.keyring $tmp.foo.keyring $tmp.bar.keyring -echo OK \ No newline at end of file +echo OK diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index e6473c5e417..544833860ba 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -620,7 +620,8 @@ bool AuthMonitor::preprocess_command(MonOpRequestRef op) auth.key.encode_plaintext(rdata); } r = 0; - } else if (prefix == "auth list") { + } else if (prefix == "auth list" || + prefix == "auth ls") { if (f) { mon->key_server.encode_formatted("auth", f.get(), rdata); } else { diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 5c6e83983f3..ac50279cc54 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -154,7 +154,9 @@ COMMAND("auth print-key name=entity,type=CephString", "display requested key", \ "auth", "rx", "cli,rest") COMMAND("auth print_key name=entity,type=CephString", "display requested key", \ "auth", "rx", "cli,rest") -COMMAND("auth list", "list authentication state", "auth", "rx", "cli,rest") +COMMAND_WITH_FLAG("auth list", "list authentication state", "auth", "rx", "cli,rest", + FLAG(DEPRECATED)) +COMMAND("auth ls", "list authentication state", "auth", "rx", "cli,rest") COMMAND("auth import", "auth import: read keyring file from -i ", \ "auth", "rwx", "cli,rest") COMMAND("auth add " \ -- 2.39.5