utilities/ceph/python-cephclient/python-cephclient/fix-osd-crush-remove.patch

26 lines
1.1 KiB
Diff

---
cephclient/wrapper.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: git/cephclient/wrapper.py
===================================================================
--- git.orig/cephclient/wrapper.py
+++ git/cephclient/wrapper.py
@@ -449,9 +449,13 @@ class CephWrapper(client.CephClient):
return self.put('osd/crush/move?name={0}&args={1}'
.format(name, args), **kwargs)
- def osd_crush_remove(self, name, ancestor, **kwargs):
- return self.put('osd/crush/remove?name={0}&ancestor={1}'
- .format(name, ancestor), **kwargs)
+ def osd_crush_remove(self, name, ancestor=None, **kwargs):
+ if ancestor:
+ return self.put('osd/crush/remove?name={0}&ancestor={1}'
+ .format(name, ancestor), **kwargs)
+ else:
+ return self.put('osd/crush/remove?name={0}'
+ .format(name), **kwargs)
def osd_crush_reweight(self, name, weight, **kwargs):
return self.put('osd/crush/reweight?name={0}&weight={1}'