Merge lp:~xfactor973/charm-helpers/ceph-configkey-bugfix into lp:charm-helpers

Proposed by Chris Holcombe
Status: Merged
Merged at revision: 538
Proposed branch: lp:~xfactor973/charm-helpers/ceph-configkey-bugfix
Merge into: lp:charm-helpers
Diff against target: 76 lines (+8/-8)
2 files modified
charmhelpers/contrib/storage/linux/ceph.py (+4/-4)
tests/contrib/storage/test_linux_ceph.py (+4/-4)
To merge this branch: bzr merge lp:~xfactor973/charm-helpers/ceph-configkey-bugfix
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
Review via email: mp+288146@code.launchpad.net

Description of the change

I messed up the ceph commands on the config-key set/get/del There's an extra ceph parameter in there that shouldn't be there.

To post a comment you must log in.
Revision history for this message
Charles Butler (lazypower) wrote :

+1 LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/contrib/storage/linux/ceph.py'
--- charmhelpers/contrib/storage/linux/ceph.py 2016-03-02 18:16:42 +0000
+++ charmhelpers/contrib/storage/linux/ceph.py 2016-03-04 18:17:10 +0000
@@ -271,7 +271,7 @@
271 try:271 try:
272 mon_status = check_output(272 mon_status = check_output(
273 ['ceph', '--id', service,273 ['ceph', '--id', service,
274 'ceph', 'mon_status', '--format=json'])274 'mon_status', '--format=json'])
275 try:275 try:
276 return json.loads(mon_status)276 return json.loads(mon_status)
277 except ValueError as v:277 except ValueError as v:
@@ -321,7 +321,7 @@
321 try:321 try:
322 check_output(322 check_output(
323 ['ceph', '--id', service,323 ['ceph', '--id', service,
324 'ceph', 'config-key', 'del', str(key)])324 'config-key', 'del', str(key)])
325 except CalledProcessError as e:325 except CalledProcessError as e:
326 log("Monitor config-key put failed with message: {}".format(326 log("Monitor config-key put failed with message: {}".format(
327 e.output))327 e.output))
@@ -339,7 +339,7 @@
339 try:339 try:
340 check_output(340 check_output(
341 ['ceph', '--id', service,341 ['ceph', '--id', service,
342 'ceph', 'config-key', 'put', str(key), str(value)])342 'config-key', 'put', str(key), str(value)])
343 except CalledProcessError as e:343 except CalledProcessError as e:
344 log("Monitor config-key put failed with message: {}".format(344 log("Monitor config-key put failed with message: {}".format(
345 e.output))345 e.output))
@@ -356,7 +356,7 @@
356 try:356 try:
357 output = check_output(357 output = check_output(
358 ['ceph', '--id', service,358 ['ceph', '--id', service,
359 'ceph', 'config-key', 'get', str(key)])359 'config-key', 'get', str(key)])
360 return output360 return output
361 except CalledProcessError as e:361 except CalledProcessError as e:
362 log("Monitor config-key get failed with message: {}".format(362 log("Monitor config-key get failed with message: {}".format(
363363
=== modified file 'tests/contrib/storage/test_linux_ceph.py'
--- tests/contrib/storage/test_linux_ceph.py 2016-03-02 18:16:42 +0000
+++ tests/contrib/storage/test_linux_ceph.py 2016-03-04 18:17:10 +0000
@@ -414,13 +414,13 @@
414414
415 def test_set_monitor_key(self):415 def test_set_monitor_key(self):
416 cmd = ['ceph', '--id', 'admin',416 cmd = ['ceph', '--id', 'admin',
417 'ceph', 'config-key', 'put', 'foo', 'bar']417 'config-key', 'put', 'foo', 'bar']
418 ceph_utils.monitor_key_set(service='admin', key='foo', value='bar')418 ceph_utils.monitor_key_set(service='admin', key='foo', value='bar')
419 self.check_output.assert_called_with(cmd)419 self.check_output.assert_called_with(cmd)
420420
421 def test_get_monitor_key(self):421 def test_get_monitor_key(self):
422 cmd = ['ceph', '--id', 'admin',422 cmd = ['ceph', '--id', 'admin',
423 'ceph', 'config-key', 'get', 'foo']423 'config-key', 'get', 'foo']
424 ceph_utils.monitor_key_get(service='admin', key='foo')424 ceph_utils.monitor_key_get(service='admin', key='foo')
425 self.check_output.assert_called_with(cmd)425 self.check_output.assert_called_with(cmd)
426426
@@ -449,7 +449,7 @@
449 def test_delete_monitor_key(self):449 def test_delete_monitor_key(self):
450 ceph_utils.monitor_key_delete(service='admin', key='foo')450 ceph_utils.monitor_key_delete(service='admin', key='foo')
451 cmd = ['ceph', '--id', 'admin',451 cmd = ['ceph', '--id', 'admin',
452 'ceph', 'config-key', 'del', 'foo']452 'config-key', 'del', 'foo']
453 self.check_output.assert_called_with(cmd)453 self.check_output.assert_called_with(cmd)
454454
455 def test_delete_monitor_key_failed(self):455 def test_delete_monitor_key_failed(self):
@@ -463,7 +463,7 @@
463 def test_get_monmap(self):463 def test_get_monmap(self):
464 self.check_output.return_value = MONMAP_DUMP464 self.check_output.return_value = MONMAP_DUMP
465 cmd = ['ceph', '--id', 'admin',465 cmd = ['ceph', '--id', 'admin',
466 'ceph', 'mon_status', '--format=json']466 'mon_status', '--format=json']
467 ceph_utils.get_mon_map(service='admin')467 ceph_utils.get_mon_map(service='admin')
468 self.check_output.assert_called_with(cmd)468 self.check_output.assert_called_with(cmd)
469469

Subscribers

People subscribed via source and target branches