Merge lp:~gnuoy/charms/trusty/rabbitmq-server/vhost-fix into lp:~openstack-charmers-archive/charms/trusty/rabbitmq-server/next

Proposed by Liam Young
Status: Rejected
Rejected by: Billy Olsen
Proposed branch: lp:~gnuoy/charms/trusty/rabbitmq-server/vhost-fix
Merge into: lp:~openstack-charmers-archive/charms/trusty/rabbitmq-server/next
Diff against target: 15 lines (+2/-3)
1 file modified
hooks/rabbit_utils.py (+2/-3)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/rabbitmq-server/vhost-fix
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+251627@code.launchpad.net

Description of the change

The output of rabbitmqctl list_vhosts has changed in the new version (~ 3.4) so that it no longer ends with '...done.' which breaks the current logic of throwing away the last element in the list returned by subprocess.

This mp switches to using '-q' to suppress 'Listing vhosts ...' and '...done.' from the output.

It also stops throwing away '/' from the vhost list since '/' is a valid vhost.

To post a comment you must log in.
Revision history for this message
Billy Olsen (billy-olsen) wrote :

Liam,

This looks mostly fine, but was superceded by JuanJo's MP - lp:~jjo/charms/trusty/rabbitmq-server/use-rabbitmqctl-q-for-list-cmds, which also handled the user listing info. So marking this as disapprove and you can use his.

Billy

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2399 rabbitmq-server-next for gnuoy mp251627
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  unit_tests/test_rabbitmq_server_relations.py:6:1: E402 module level import not at top of file
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10520230/
Build: http://10.245.162.77:8080/job/charm_lint_check/2399/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #2189 rabbitmq-server-next for gnuoy mp251627
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2189/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2319 rabbitmq-server-next for gnuoy mp251627
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [functional_test] Error 1

Full amulet test output: http://paste.ubuntu.com/10520603/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2319/

Unmerged revisions

83. By Liam Young

Stop throwing away first and last vhosts

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/rabbit_utils.py'
2--- hooks/rabbit_utils.py 2015-01-22 15:37:28 +0000
3+++ hooks/rabbit_utils.py 2015-03-03 16:58:28 +0000
4@@ -80,9 +80,8 @@
5 Returns a list of all the available vhosts
6 """
7 try:
8- output = subprocess.check_output([RABBITMQ_CTL, 'list_vhosts'])
9-
10- return output.split('\n')[1:-2]
11+ output = subprocess.check_output([RABBITMQ_CTL, '-q', 'list_vhosts'])
12+ return output.rstrip().split('\n')
13 except Exception as ex:
14 # if no vhosts, just raises an exception
15 log(str(ex), level='DEBUG')

Subscribers

People subscribed via source and target branches