Merge lp:~hopem/charm-helpers/lp1517846.2 into lp:charm-helpers

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 486
Proposed branch: lp:~hopem/charm-helpers/lp1517846.2
Merge into: lp:charm-helpers
Diff against target: 33 lines (+11/-4)
1 file modified
charmhelpers/contrib/storage/linux/ceph.py (+11/-4)
To merge this branch: bzr merge lp:~hopem/charm-helpers/lp1517846.2
Reviewer Review Type Date Requested Status
Billy Olsen Approve
charmers Pending
Review via email: mp+278056@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Billy Olsen (billy-olsen) wrote :

LGTM, Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/storage/linux/ceph.py'
2--- charmhelpers/contrib/storage/linux/ceph.py 2015-11-19 16:31:16 +0000
3+++ charmhelpers/contrib/storage/linux/ceph.py 2015-11-19 18:45:46 +0000
4@@ -422,9 +422,16 @@
5 self.request_id = str(uuid.uuid1())
6 self.ops = []
7
8- def add_op_create_pool(self, name, replica_count=3):
9+ def add_op_create_pool(self, name, replica_count=3, pg_num=None):
10+ """Adds an operation to create a pool.
11+
12+ @param pg_num setting: optional setting. If not provided, this value
13+ will be calculated by the broker based on how many OSDs are in the
14+ cluster at the time of creation. Note that, if provided, this value
15+ will be capped at the current available maximum.
16+ """
17 self.ops.append({'op': 'create-pool', 'name': name,
18- 'replicas': replica_count})
19+ 'replicas': replica_count, 'pg_num': pg_num})
20
21 def set_ops(self, ops):
22 """Set request ops to provided value.
23@@ -442,8 +449,8 @@
24 def _ops_equal(self, other):
25 if len(self.ops) == len(other.ops):
26 for req_no in range(0, len(self.ops)):
27- for key in ['replicas', 'name', 'op']:
28- if self.ops[req_no][key] != other.ops[req_no][key]:
29+ for key in ['replicas', 'name', 'op', 'pg_num']:
30+ if self.ops[req_no].get(key) != other.ops[req_no].get(key):
31 return False
32 else:
33 return False

Subscribers

People subscribed via source and target branches