From d4b02b3bb67cfa601eb2adfbff1fcc2ce6c63812 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Sat, 22 Aug 2015 06:52:32 +0000 Subject: [PATCH] ch sync --- hooks/charmhelpers/contrib/storage/linux/ceph.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hooks/charmhelpers/contrib/storage/linux/ceph.py b/hooks/charmhelpers/contrib/storage/linux/ceph.py index 9d03560..767902d 100644 --- a/hooks/charmhelpers/contrib/storage/linux/ceph.py +++ b/hooks/charmhelpers/contrib/storage/linux/ceph.py @@ -40,6 +40,7 @@ from charmhelpers.core.hookenv import ( relation_get, relation_ids, related_units, + remote_unit, log, DEBUG, INFO, @@ -417,7 +418,6 @@ class CephBrokerRq(object): self.api_version = api_version self.request_id = str(uuid.uuid1()) self.ops = [] - log('Received request {}'.format(self.request_id)) def add_op_create_pool(self, name, replica_count=3): self.ops.append({'op': 'create-pool', 'name': name, @@ -475,3 +475,14 @@ class CephBrokerRsp(object): log('request-id {} is expected'.format(self.request_id)) return self.VALID + +def duplicate_broker_requests(encoded_req1, encoded_req2): + req1 = json.loads(encoded_req1) + req2 = json.loads(encoded_req2) + if len(req1['ops']) != len(req2['ops']): + return False + for req_no in range(0,len(req1['ops'])): + for key in ['replicas', 'name', 'op']: + if req1['ops'][req_no][key] != req2['ops'][req_no][key]: + return False + return True