]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/admin: make injected_args optional
authorKefu Chai <kchai@redhat.com>
Thu, 27 Aug 2020 13:15:42 +0000 (21:15 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 31 Aug 2020 13:15:10 +0000 (21:15 +0800)
this option for `injectargs` command is optional, so we should not
crash if it does not exist.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/admin/admin_socket.cc

index 29ad2095bab6056311f2b76db341983a3cdacfe1..2913298d0d5808f3ab97e1a271b9e19960fd7ba0 100644 (file)
@@ -397,8 +397,9 @@ public:
                                      ceph::bufferlist&&) const final
   {
     std::vector<std::string> argv;
-    [[maybe_unused]] bool found = cmd_getval(cmdmap, "injected_args", argv);
-    assert(found);
+    if (!cmd_getval(cmdmap, "injected_args", argv)) {
+      return seastar::make_ready_future<tell_result_t>();
+    }
     const std::string args = boost::algorithm::join(argv, " ");
     return local_conf().inject_args(args).then([] {
       return seastar::make_ready_future<tell_result_t>();