]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: allow open-ended life expectancy
authorSage Weil <sage@redhat.com>
Fri, 8 Jun 2018 03:04:09 +0000 (22:04 -0500)
committerSage Weil <sage@redhat.com>
Mon, 11 Jun 2018 12:29:04 +0000 (07:29 -0500)
If you leave off the second part of the life expectancy interval, it means
"more than".  e.g., Setting only the first time to today + one month would
mean "more than one month".

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc
src/mgr/MgrCommands.h

index 7f1e1cfb9513781520621a72d657c02edd662d5d..f8c7747984666ee4e6d1ab485237c2caccd42f22 100644 (file)
@@ -1834,7 +1834,7 @@ bool DaemonServer::handle_command(MCommand *m)
       ss << "unable to parse datetime '" << from_str << "'";
       r = -EINVAL;
       cmdctx->reply(r, ss);
-    } else if (!to.parse(to_str)) {
+    } else if (to_str.size() && !to.parse(to_str)) {
       ss << "unable to parse datetime '" << to_str << "'";
       r = -EINVAL;
       cmdctx->reply(r, ss);
index 746ed02e52e53f16ba2699131eba95fcb2b55464..17a3671aa926c929176702bed74760f999808c0e 100644 (file)
@@ -155,7 +155,7 @@ COMMAND("device ls-by-host name=host,type=CephString",
        "mgr", "r", "cli,rest")
 COMMAND("device set-life-expectancy name=devid,type=CephString "\
        "name=from,type=CephString "\
-       "name=to,type=CephString",
+       "name=to,type=CephString,req=False",
        "Set predicted device life expectancy",
        "mgr", "rw", "cli,rest")
 COMMAND("device rm-life-expectancy name=devid,type=CephString",