diff options
author | Sage Weil <sage@inktank.com> | 2013-04-18 11:19:56 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-04-18 11:20:20 -0700 |
commit | b0c1001a5e29c9cc4465497b3cac06db89ddccb2 (patch) | |
tree | 736fc35db1199de55b9aff56dbc30bd42c52c77a | |
parent | 0d46dc4646b1da7e4ca58a9580f7123b961f9019 (diff) | |
download | ceph-b0c1001a5e29c9cc4465497b3cac06db89ddccb2.tar.gz |
mon: ensure 'osd crush rule ...' commands are idempotent
Ensure that we return 0 for these cases.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/mon/OSDMonitor.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ec15d0abd28..8868189446d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2813,6 +2813,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m) if (newcrush.rule_exists(name)) { ss << "rule " << name << " already exists"; + err = 0; } else { int rule = newcrush.add_simple_rule(name, root, type); if (rule < 0) { @@ -2844,6 +2845,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m) if (!newcrush.rule_exists(name)) { ss << "rule " << name << " does not exist"; + err = 0; } else { int ruleno = newcrush.get_rule_id(name); assert(ruleno >= 0); |