]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: 'config-key put' -> 'config-key set'
authorSage Weil <sage@redhat.com>
Tue, 25 Jul 2017 15:24:50 +0000 (11:24 -0400)
committerSage Weil <sage@redhat.com>
Wed, 26 Jul 2017 18:10:08 +0000 (14:10 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
19 files changed:
doc/man/8/ceph.rst
doc/mgr/dashboard.rst
doc/mgr/prometheus.rst
doc/mgr/restful.rst
doc/mgr/zabbix.rst
qa/workunits/cephtool/test.sh
qa/workunits/mon/caps.py
src/brag/client/ceph-brag
src/mgr/PyModules.cc
src/mon/ConfigKeyService.cc
src/mon/MonCap.cc
src/mon/MonCommands.h
src/pybind/mgr/dashboard/README.rst
src/pybind/mgr/dashboard/module.py
src/pybind/mgr/restful/module.py
src/pybind/mgr/zabbix/module.py
src/test/mgr/mgr-dashboard-smoke.sh
src/test/mon/moncap.cc
src/vstart.sh

index 01fe04f12c0d424c2188c3f2a7466792436698a6..0f372d9714be5ee6498ab466dc4f1940bc677aa8 100644 (file)
@@ -207,11 +207,11 @@ Usage::
 
        ceph config-key dump
 
-Subcommand ``put`` puts configuration key and value.
+Subcommand ``set`` puts configuration key and value.
 
 Usage::
 
-       ceph config-key put <key> {<val>}
+       ceph config-key set <key> {<val>}
 
 
 daemon
index ac1b961f7150dfd0c6630a03794f22ddc31c8696..8908497003dae367fe2244e879135e1a3998d214 100644 (file)
@@ -23,8 +23,8 @@ Since each ``ceph-mgr`` hosts its own instance of dashboard, it may
 also be necessary to configure them separately. The hostname and port
 can be changed via the configuration key facility::
 
-  ceph config-key put mgr/dashboard/$name/server_addr $IP
-  ceph config-key put mgr/dashboard/$name/server_port $PORT
+  ceph config-key set mgr/dashboard/$name/server_addr $IP
+  ceph config-key set mgr/dashboard/$name/server_port $PORT
 
 where ``$name`` is the ID of the ceph-mgr who is hosting this
 dashboard web app.
@@ -32,8 +32,8 @@ dashboard web app.
 These settings can also be configured cluster-wide and not manager
 specific.  For example,::
 
-  ceph config-key put mgr/dashboard/server_addr $IP
-  ceph config-key put mgr/dashboard/server_port $PORT
+  ceph config-key set mgr/dashboard/server_addr $IP
+  ceph config-key set mgr/dashboard/server_port $PORT
 
 If the port is not configured, the web app will bind to port ``7000``.
 If the address it not configured, the web app will bind to ``::``,
index 2213156bf1a3ecf6f461d4fbc7d387eb934a5db1..fc84afee4b12f1f5decf411756eb6a4a31c00aca 100644 (file)
@@ -24,7 +24,7 @@ Configuration
 
 By default the module will accept HTTP requests on port ``9283`` on all
 IPv4 and IPv6 addresses on the host.  The port and listen address are both
-configurable with ``ceph config-key put``, with keys
+configurable with ``ceph config-key set``, with keys
 ``mgr/prometheus/server_addr`` and ``mgr/prometheus/server_port``.
 This port is registered with Prometheus's `registry <https://github.com/prometheus/prometheus/wiki/Default-port-allocations>`_.
 
index 4dc33d723bb6ca1de916617b66350b497497c204..e67f2d144bdbfe16d989cd16a83ab5b07f2970eb 100644 (file)
@@ -40,15 +40,15 @@ can be generated with a command similar to::
 The ``restful.crt`` should then be signed by your organization's CA
 (certificate authority).  Once that is done, you can set it with::
 
-  ceph config-key put mgr/restful/$name/crt -i restful.crt
-  ceph config-key put mgr/restful/$name/key -i restful.key
+  ceph config-key set mgr/restful/$name/crt -i restful.crt
+  ceph config-key set mgr/restful/$name/key -i restful.key
 
 where ``$name`` is the name of the ``ceph-mgr`` instance (usually the
 hostname). If all manager instances are to share the same certificate,
 you can leave off the ``$name`` portion::
 
-  ceph config-key put mgr/restful/crt -i restful.crt
-  ceph config-key put mgr/restful/key -i restful.key
+  ceph config-key set mgr/restful/crt -i restful.crt
+  ceph config-key set mgr/restful/key -i restful.key
 
 
 Configuring IP and port
@@ -62,16 +62,16 @@ Since each ``ceph-mgr`` hosts its own instance of *restful*, it may
 also be necessary to configure them separately. The IP and port
 can be changed via the configuration key facility::
 
-  ceph config-key put mgr/restful/$name/server_addr $IP
-  ceph config-key put mgr/restful/$name/server_port $PORT
+  ceph config-key set mgr/restful/$name/server_addr $IP
+  ceph config-key set mgr/restful/$name/server_port $PORT
 
 where ``$name`` is the ID of the ceph-mgr daemon (usually the hostname).
 
 These settings can also be configured cluster-wide and not manager
 specific.  For example,::
 
-  ceph config-key put mgr/restful/server_addr $IP
-  ceph config-key put mgr/restful/server_port $PORT
+  ceph config-key set mgr/restful/server_addr $IP
+  ceph config-key set mgr/restful/server_port $PORT
 
 If the port is not configured, *restful* will bind to port ``8003``.
 If the address it not configured, the *restful* will bind to ``::``,
index 70217b4ad711cfd8af0c07152abf06f21734db5c..d98540e869692b4ecaef25e5000467c7c1a1a562 100644 (file)
@@ -79,14 +79,14 @@ these are usually Monitors where the *client.admin* key is present.
 
 ::
 
-    ceph config-key put <key> <value>
+    ceph config-key set <key> <value>
 
 For example:
 
 ::
 
-    ceph config-key put mgr/zabbix/zabbix_host zabbix.localdomain
-    ceph config-key put mgr/zabbix/identifier ceph.eu-ams02.local
+    ceph config-key set mgr/zabbix/zabbix_host zabbix.localdomain
+    ceph config-key set mgr/zabbix/identifier ceph.eu-ams02.local
 
 Debugging
 ---------
index 8e74344c9efb07f1b6185218e46d94bb3493b448..e10814543a03e180d4322a6a17523f9334c81fb3 100755 (executable)
@@ -2403,7 +2403,7 @@ function test_mon_tell_help_command()
 
 function test_mon_stdin_stdout()
 {
-  echo foo | ceph config-key put test_key -i -
+  echo foo | ceph config-key set test_key -i -
   ceph config-key get test_key -o - | grep -c foo | grep -q 1
 }
 
@@ -2476,6 +2476,7 @@ MON_TESTS+=" auth_profiles"
 MON_TESTS+=" mon_misc"
 MON_TESTS+=" mon_mon"
 MON_TESTS+=" mon_osd"
+MON_TESTS+=" mon_config_key"
 MON_TESTS+=" mon_crush"
 MON_TESTS+=" mon_osd_create_destroy"
 MON_TESTS+=" mon_osd_pool"
index f1d0850f36c2b4f18e6dab97b9e3c0205e714497..65a695641c6b23685b9b7421128a317bf92559c0 100644 (file)
@@ -265,11 +265,11 @@ def test_all():
         ],
       'config-key':[
           {
-            'pre':'config-key put foo bar',
+            'pre':'config-key set foo bar',
             'cmd':('config-key get', 'key=foo', 'r')
             },
           {
-            'pre':'config-key put foo bar',
+            'pre':'config-key set foo bar',
             'cmd':('config-key del', 'key=foo', 'rw')
             }
           ]
index d5e5a2ded208f7ca12dfe3e29fd88de6637ca72a..7df516740f2af1eac7cb2ec0568c45fd82d1293b 100755 (executable)
@@ -226,10 +226,10 @@ def get_uuid():
   if rc:
     #uuid is not yet set.
     uid = str(uuid.uuid4())
-    (rc, o, e) = run_command(['ceph', 'config-key', 'put',
+    (rc, o, e) = run_command(['ceph', 'config-key', 'set',
                              CLUSTER_UUID_NAME, uid])
     if rc:
-      raise RuntimeError("\'ceph config-key put\' failed -" + e)
+      raise RuntimeError("\'ceph config-key set\' failed -" + e)
 
   return uid
 
index 74628dbbf1c7b8f71fbf86c5920b7f9fb71f1d0f..05a663bca7b75b1593b07faa83de8c0496e5bf05 100644 (file)
@@ -592,7 +592,7 @@ void PyModules::set_config(const std::string &handle,
 
     JSONFormatter jf;
     jf.open_object_section("cmd");
-    jf.dump_string("prefix", "config-key put");
+    jf.dump_string("prefix", "config-key set");
     jf.dump_string("key", global_key);
     jf.dump_string("val", val);
     jf.close_section();
@@ -603,10 +603,10 @@ void PyModules::set_config(const std::string &handle,
   set_cmd.wait();
 
   if (set_cmd.r != 0) {
-    // config-key put will fail if mgr's auth key has insufficient
+    // config-key set will fail if mgr's auth key has insufficient
     // permission to set config keys
     // FIXME: should this somehow raise an exception back into Python land?
-    dout(0) << "`config-key put " << global_key << " " << val << "` failed: "
+    dout(0) << "`config-key set " << global_key << " " << val << "` failed: "
       << cpp_strerror(set_cmd.r) << dendl;
     dout(0) << "mon returned " << set_cmd.r << ": " << set_cmd.outs << dendl;
   }
index f8e9e1aaf3dc7883370bc16e33a716d2b2099971..29ae9d959427aa4c38872fddb33607b44b1c6e24 100644 (file)
@@ -184,7 +184,8 @@ bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
     }
     ss << "obtained '" << key << "'";
 
-  } else if (prefix == "config-key put") {
+  } else if (prefix == "config-key put" ||
+            prefix == "config-key set") {
     if (!mon->is_leader()) {
       mon->forward_request_leader(op);
       // we forward the message; so return now.
index f6f2b74f4ea1f89c1e6c52d987c6ce69ef91d99e..3096fd2b46ad16ff1983d815ab5e56ccefd5d8ef 100644 (file)
@@ -201,6 +201,7 @@ void MonCapGrant::expand_profile_mon(const EntityName& name) const
     StringConstraint constraint(StringConstraint::MATCH_TYPE_PREFIX,
                                 "daemon-private/mgr/");
     profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
+    profile_grants.push_back(MonCapGrant("config-key set", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key put", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key exists", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key delete", "key", constraint));
@@ -213,6 +214,7 @@ void MonCapGrant::expand_profile_mon(const EntityName& name) const
     string prefix = string("daemon-private/") + stringify(name) + string("/");
     profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key put", "key", constraint));
+    profile_grants.push_back(MonCapGrant("config-key set", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key exists", "key", constraint));
     profile_grants.push_back(MonCapGrant("config-key delete", "key", constraint));
   }
index 41e3f79f1175a7e6f3ccb170ae50183b91d8f929..a6b56d9def26afb0153b16f4038050e944820fdc 100644 (file)
@@ -1015,10 +1015,15 @@ COMMAND("osd tier add-cache " \
 COMMAND("config-key get " \
        "name=key,type=CephString", \
        "get <key>", "config-key", "r", "cli,rest")
-COMMAND("config-key put " \
+COMMAND("config-key set " \
        "name=key,type=CephString " \
        "name=val,type=CephString,req=false", \
-       "put <key>, value <val>", "config-key", "rw", "cli,rest")
+       "set <key> to value <val>", "config-key", "rw", "cli,rest")
+COMMAND_WITH_FLAG("config-key put " \
+                 "name=key,type=CephString " \
+                 "name=val,type=CephString,req=false",                 \
+                 "put <key>, value <val>", "config-key", "rw", "cli,rest",
+                 FLAG(DEPRECATED))
 COMMAND("config-key del " \
        "name=key,type=CephString", \
        "delete <key>", "config-key", "rw", "cli,rest")
index 34158849c9e6852d6f371cce8517c822b088a89d..dd715b60ed8a30bf6f37934dfd9c91aca3c202ad 100644 (file)
@@ -39,7 +39,7 @@ IPv4 and IPv6 addresses.
 
 ::
 
-    ceph config-key put mgr/dashboard/server_addr ::
+    ceph config-key set mgr/dashboard/server_addr ::
 
 Restart the ceph-mgr daemon after modifying the setting to load the module.
 
index 7e2a4260a03e6d0455eef9348a1de159a78fe4c6..3728e8d07e02c03330d5ccca87c9a14a3d0c6640 100644 (file)
@@ -794,7 +794,7 @@ class Module(MgrModule):
         server_addr = self.get_localized_config('server_addr', '::')
         server_port = self.get_localized_config('server_port', '7000')
         if server_addr is None:
-            raise RuntimeError('no server_addr configured; try "ceph config-key put mgr/dashboard/server_addr <ip>"')
+            raise RuntimeError('no server_addr configured; try "ceph config-key set mgr/dashboard/server_addr <ip>"')
         log.info("server_addr: %s server_port: %s" % (server_addr, server_port))
         cherrypy.config.update({
             'server.socket_host': server_addr,
index 52455d0074748aec284e32a34e804e13ad385bd5..63fcae72a5a21c384166ae91c026ddcc770b5acb 100644 (file)
@@ -272,7 +272,7 @@ class Module(MgrModule):
 
         server_addr = self.get_localized_config('server_addr', '::')
         if server_addr is None:
-            raise RuntimeError('no server_addr configured; try "ceph config-key put mgr/restful/server_addr <ip>"')
+            raise RuntimeError('no server_addr configured; try "ceph config-key set mgr/restful/server_addr <ip>"')
         server_port = int(self.get_localized_config('server_port', '8003'))
         self.log.info('server_addr: %s server_port: %d',
                       server_addr, server_port)
index 1313ede4cc71beaaa2e11edd9b12bab1101b71ae..eb2eba11a1ffe56e0348a2fb4b6dcdf194a24604 100644 (file)
@@ -87,7 +87,7 @@ class Module(MgrModule):
             value = self.get_localized_config(key, default)
             if value is None:
                 raise RuntimeError('Configuration key {0} not set; "ceph '
-                                   'config-key put mgr/zabbix/{0} '
+                                   'config-key set mgr/zabbix/{0} '
                                    '<value>"'.format(key))
 
             self.set_config_option(key, value)
index 353c4d45a03fd132d7e12565aab61199876ffa97..778b36f3520c065ba5ffa0d2db9862ff3508e6b7 100755 (executable)
@@ -33,7 +33,7 @@ function run() {
 
     timeout 360 ceph --mon-host $MON mon stat || return 1
     export CEPH_ARGS="--mon_host $MON "
-    ceph config-key put mgr/x/dashboard/server_port 7001
+    ceph config-key set mgr/x/dashboard/server_port 7001
     MGR_ARGS+="--mgr_module_path=${CEPH_ROOT}/src/pybind/mgr "
     run_mgr $dir x ${MGR_ARGS} || return 1
 
index a3379eefc6c79aabf8053750b1495508cea15443..126bd45dee1593293430ccc88178de6c77bbcbc9 100644 (file)
@@ -236,6 +236,8 @@ TEST(MonCap, ProfileOSD) {
                             name, "", "config-key get", ca, true, true, true));
   ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
                             name, "", "config-key put", ca, true, true, true));
+  ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
+                            name, "", "config-key set", ca, true, true, true));
   ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
                             name, "", "config-key exists", ca, true, true, true));
   ASSERT_TRUE(cap.is_capable(NULL, CEPH_ENTITY_TYPE_MON,
index 88c35d5e96fd6f3250462261c4bd88aaa29d6025..51667a94aff21f12b8dfcc2f59bdab6c3335b4a0 100755 (executable)
@@ -658,11 +658,11 @@ start_mgr() {
         host = $HOSTNAME
 EOF
 
-       ceph_adm config-key put mgr/dashboard/$name/server_port $MGR_PORT
+       ceph_adm config-key set mgr/dashboard/$name/server_port $MGR_PORT
        DASH_URLS+="http://$IP:$MGR_PORT/"
        MGR_PORT=$(($MGR_PORT + 1000))
 
-       ceph_adm config-key put mgr/restful/$name/server_port $MGR_PORT
+       ceph_adm config-key set mgr/restful/$name/server_port $MGR_PORT
 
        RESTFUL_URLS+="https://$IP:$MGR_PORT"
        MGR_PORT=$(($MGR_PORT + 1000))