From: Sage Weil Date: Fri, 8 Jun 2018 03:04:09 +0000 (-0500) Subject: mgr: allow open-ended life expectancy X-Git-Tag: v14.0.1~1131^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3030fb8512bc8db0da5c37e1944c56c1b15e246b;p=ceph.git mgr: allow open-ended life expectancy 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 --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 7f1e1cfb9513..f8c774798466 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -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); diff --git a/src/mgr/MgrCommands.h b/src/mgr/MgrCommands.h index 746ed02e52e5..17a3671aa926 100644 --- a/src/mgr/MgrCommands.h +++ b/src/mgr/MgrCommands.h @@ -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",