Merge lp:~james-page/charms/trusty/swift-storage/lp1531102-trunk into lp:~openstack-charmers-archive/charms/trusty/swift-storage/trunk

Proposed by James Page on 2016-01-07
Status: Needs review
Proposed branch: lp:~james-page/charms/trusty/swift-storage/lp1531102-trunk
Merge into: lp:~openstack-charmers-archive/charms/trusty/swift-storage/trunk
Diff against target: 584 lines (+285/-36)
8 files modified
charmhelpers/contrib/openstack/amulet/deployment.py (+100/-1)
charmhelpers/contrib/openstack/amulet/utils.py (+25/-3)
charmhelpers/contrib/openstack/utils.py (+21/-17)
charmhelpers/contrib/storage/linux/loopback.py (+0/-10)
charmhelpers/core/host.py (+12/-1)
charmhelpers/core/hugepage.py (+2/-0)
tests/charmhelpers/contrib/openstack/amulet/deployment.py (+100/-1)
tests/charmhelpers/contrib/openstack/amulet/utils.py (+25/-3)
To merge this branch: bzr merge lp:~james-page/charms/trusty/swift-storage/lp1531102-trunk
Reviewer Review Type Date Requested Status
Liam Young 2016-01-07 Needs Fixing on 2016-01-13
Review via email: mp+281873@code.launchpad.net

Commit message

Resync helpers

Description of the change

Resync stable helpers to resolve liberty point release version detection problems.

To post a comment you must log in.

charm_unit_test #15629 swift-storage for james-page mp281873
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full unit test output: http://paste.ubuntu.com/14430274/
Build: http://10.245.162.77:8080/job/charm_unit_test/15629/

charm_lint_check #16744 swift-storage for james-page mp281873
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/16744/

charm_amulet_test #8562 swift-storage for james-page mp281873
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

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

charm_amulet_test #8574 swift-storage for james-page mp281873
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

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

Ryan Beisner (1chb1n) wrote :

@jamespage FYI, swift-storage/0 unit install hook fails with:

2016-01-07 22:50:30 INFO install Setting up python-six (1.1.0-2) ...
2016-01-07 22:50:31 INFO install Traceback (most recent call last):
2016-01-07 22:50:31 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/install.real", line 6, in <module>
2016-01-07 22:50:31 INFO install from lib.swift_storage_utils import (
2016-01-07 22:50:31 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/lib/swift_storage_utils.py", line 49, in <module>
2016-01-07 22:50:31 INFO install from charmhelpers.contrib.storage.linux.loopback import (
2016-01-07 22:50:31 INFO install ImportError: cannot import name is_mapped_loopback_device
2016-01-07 22:50:31 INFO juju.worker.uniter.context context.go:579 handling reboot
2016-01-07 22:50:31 ERROR juju.worker.uniter.operation runhook.go:107 hook "install" failed: exit status 1
2016-01-07 22:50:31 DEBUG juju.worker.uniter modes.go:31 [AGENT-STATUS] failed: run install hook

Liam Young (gnuoy) :
review: Needs Fixing

Unmerged revisions

77. By James Page on 2016-01-07

Resync charm-helpers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/amulet/deployment.py'
2--- charmhelpers/contrib/openstack/amulet/deployment.py 2015-10-22 13:25:25 +0000
3+++ charmhelpers/contrib/openstack/amulet/deployment.py 2016-01-07 14:34:44 +0000
4@@ -14,12 +14,18 @@
5 # You should have received a copy of the GNU Lesser General Public License
6 # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
7
8+import logging
9+import re
10+import sys
11 import six
12 from collections import OrderedDict
13 from charmhelpers.contrib.amulet.deployment import (
14 AmuletDeployment
15 )
16
17+DEBUG = logging.DEBUG
18+ERROR = logging.ERROR
19+
20
21 class OpenStackAmuletDeployment(AmuletDeployment):
22 """OpenStack amulet deployment.
23@@ -28,9 +34,12 @@
24 that is specifically for use by OpenStack charms.
25 """
26
27- def __init__(self, series=None, openstack=None, source=None, stable=True):
28+ def __init__(self, series=None, openstack=None, source=None,
29+ stable=True, log_level=DEBUG):
30 """Initialize the deployment environment."""
31 super(OpenStackAmuletDeployment, self).__init__(series)
32+ self.log = self.get_logger(level=log_level)
33+ self.log.info('OpenStackAmuletDeployment: init')
34 self.openstack = openstack
35 self.source = source
36 self.stable = stable
37@@ -38,6 +47,22 @@
38 # out.
39 self.current_next = "trusty"
40
41+ def get_logger(self, name="deployment-logger", level=logging.DEBUG):
42+ """Get a logger object that will log to stdout."""
43+ log = logging
44+ logger = log.getLogger(name)
45+ fmt = log.Formatter("%(asctime)s %(funcName)s "
46+ "%(levelname)s: %(message)s")
47+
48+ handler = log.StreamHandler(stream=sys.stdout)
49+ handler.setLevel(level)
50+ handler.setFormatter(fmt)
51+
52+ logger.addHandler(handler)
53+ logger.setLevel(level)
54+
55+ return logger
56+
57 def _determine_branch_locations(self, other_services):
58 """Determine the branch locations for the other services.
59
60@@ -45,6 +70,8 @@
61 stable or next (dev) branch, and based on this, use the corresonding
62 stable or next branches for the other_services."""
63
64+ self.log.info('OpenStackAmuletDeployment: determine branch locations')
65+
66 # Charms outside the lp:~openstack-charmers namespace
67 base_charms = ['mysql', 'mongodb', 'nrpe']
68
69@@ -82,6 +109,8 @@
70
71 def _add_services(self, this_service, other_services):
72 """Add services to the deployment and set openstack-origin/source."""
73+ self.log.info('OpenStackAmuletDeployment: adding services')
74+
75 other_services = self._determine_branch_locations(other_services)
76
77 super(OpenStackAmuletDeployment, self)._add_services(this_service,
78@@ -111,9 +140,79 @@
79
80 def _configure_services(self, configs):
81 """Configure all of the services."""
82+ self.log.info('OpenStackAmuletDeployment: configure services')
83 for service, config in six.iteritems(configs):
84 self.d.configure(service, config)
85
86+ def _auto_wait_for_status(self, message=None, exclude_services=None,
87+ include_only=None, timeout=1800):
88+ """Wait for all units to have a specific extended status, except
89+ for any defined as excluded. Unless specified via message, any
90+ status containing any case of 'ready' will be considered a match.
91+
92+ Examples of message usage:
93+
94+ Wait for all unit status to CONTAIN any case of 'ready' or 'ok':
95+ message = re.compile('.*ready.*|.*ok.*', re.IGNORECASE)
96+
97+ Wait for all units to reach this status (exact match):
98+ message = re.compile('^Unit is ready and clustered$')
99+
100+ Wait for all units to reach any one of these (exact match):
101+ message = re.compile('Unit is ready|OK|Ready')
102+
103+ Wait for at least one unit to reach this status (exact match):
104+ message = {'ready'}
105+
106+ See Amulet's sentry.wait_for_messages() for message usage detail.
107+ https://github.com/juju/amulet/blob/master/amulet/sentry.py
108+
109+ :param message: Expected status match
110+ :param exclude_services: List of juju service names to ignore,
111+ not to be used in conjuction with include_only.
112+ :param include_only: List of juju service names to exclusively check,
113+ not to be used in conjuction with exclude_services.
114+ :param timeout: Maximum time in seconds to wait for status match
115+ :returns: None. Raises if timeout is hit.
116+ """
117+ self.log.info('Waiting for extended status on units...')
118+
119+ all_services = self.d.services.keys()
120+
121+ if exclude_services and include_only:
122+ raise ValueError('exclude_services can not be used '
123+ 'with include_only')
124+
125+ if message:
126+ if isinstance(message, re._pattern_type):
127+ match = message.pattern
128+ else:
129+ match = message
130+
131+ self.log.debug('Custom extended status wait match: '
132+ '{}'.format(match))
133+ else:
134+ self.log.debug('Default extended status wait match: contains '
135+ 'READY (case-insensitive)')
136+ message = re.compile('.*ready.*', re.IGNORECASE)
137+
138+ if exclude_services:
139+ self.log.debug('Excluding services from extended status match: '
140+ '{}'.format(exclude_services))
141+ else:
142+ exclude_services = []
143+
144+ if include_only:
145+ services = include_only
146+ else:
147+ services = list(set(all_services) - set(exclude_services))
148+
149+ self.log.debug('Waiting up to {}s for extended status on services: '
150+ '{}'.format(timeout, services))
151+ service_messages = {service: message for service in services}
152+ self.d.sentry.wait_for_messages(service_messages, timeout=timeout)
153+ self.log.info('OK')
154+
155 def _get_openstack_release(self):
156 """Get openstack release.
157
158
159=== modified file 'charmhelpers/contrib/openstack/amulet/utils.py'
160--- charmhelpers/contrib/openstack/amulet/utils.py 2015-10-22 13:25:25 +0000
161+++ charmhelpers/contrib/openstack/amulet/utils.py 2016-01-07 14:34:44 +0000
162@@ -18,6 +18,7 @@
163 import json
164 import logging
165 import os
166+import re
167 import six
168 import time
169 import urllib
170@@ -604,7 +605,22 @@
171 '{}'.format(sample_type, samples))
172 return None
173
174-# rabbitmq/amqp specific helpers:
175+ # rabbitmq/amqp specific helpers:
176+
177+ def rmq_wait_for_cluster(self, deployment, init_sleep=15, timeout=1200):
178+ """Wait for rmq units extended status to show cluster readiness,
179+ after an optional initial sleep period. Initial sleep is likely
180+ necessary to be effective following a config change, as status
181+ message may not instantly update to non-ready."""
182+
183+ if init_sleep:
184+ time.sleep(init_sleep)
185+
186+ message = re.compile('^Unit is ready and clustered$')
187+ deployment._auto_wait_for_status(message=message,
188+ timeout=timeout,
189+ include_only=['rabbitmq-server'])
190+
191 def add_rmq_test_user(self, sentry_units,
192 username="testuser1", password="changeme"):
193 """Add a test user via the first rmq juju unit, check connection as
194@@ -805,7 +821,10 @@
195 if port:
196 config['ssl_port'] = port
197
198- deployment.configure('rabbitmq-server', config)
199+ deployment.d.configure('rabbitmq-server', config)
200+
201+ # Wait for unit status
202+ self.rmq_wait_for_cluster(deployment)
203
204 # Confirm
205 tries = 0
206@@ -832,7 +851,10 @@
207
208 # Disable RMQ SSL
209 config = {'ssl': 'off'}
210- deployment.configure('rabbitmq-server', config)
211+ deployment.d.configure('rabbitmq-server', config)
212+
213+ # Wait for unit status
214+ self.rmq_wait_for_cluster(deployment)
215
216 # Confirm
217 tries = 0
218
219=== modified file 'charmhelpers/contrib/openstack/utils.py'
220--- charmhelpers/contrib/openstack/utils.py 2015-10-22 13:25:25 +0000
221+++ charmhelpers/contrib/openstack/utils.py 2016-01-07 14:34:44 +0000
222@@ -127,31 +127,31 @@
223 # >= Liberty version->codename mapping
224 PACKAGE_CODENAMES = {
225 'nova-common': OrderedDict([
226- ('12.0.0', 'liberty'),
227+ ('12.0', 'liberty'),
228 ]),
229 'neutron-common': OrderedDict([
230- ('7.0.0', 'liberty'),
231+ ('7.0', 'liberty'),
232 ]),
233 'cinder-common': OrderedDict([
234- ('7.0.0', 'liberty'),
235+ ('7.0', 'liberty'),
236 ]),
237 'keystone': OrderedDict([
238- ('8.0.0', 'liberty'),
239+ ('8.0', 'liberty'),
240 ]),
241 'horizon-common': OrderedDict([
242- ('8.0.0', 'liberty'),
243+ ('8.0', 'liberty'),
244 ]),
245 'ceilometer-common': OrderedDict([
246- ('5.0.0', 'liberty'),
247+ ('5.0', 'liberty'),
248 ]),
249 'heat-common': OrderedDict([
250- ('5.0.0', 'liberty'),
251+ ('5.0', 'liberty'),
252 ]),
253 'glance-common': OrderedDict([
254- ('11.0.0', 'liberty'),
255+ ('11.0', 'liberty'),
256 ]),
257 'openstack-dashboard': OrderedDict([
258- ('8.0.0', 'liberty'),
259+ ('8.0', 'liberty'),
260 ]),
261 }
262
263@@ -238,7 +238,14 @@
264 error_out(e)
265
266 vers = apt.upstream_version(pkg.current_ver.ver_str)
267- match = re.match('^(\d+)\.(\d+)\.(\d+)', vers)
268+ if 'swift' in pkg.name:
269+ # Fully x.y.z match for swift versions
270+ match = re.match('^(\d+)\.(\d+)\.(\d+)', vers)
271+ else:
272+ # x.y match only for 20XX.X
273+ # and ignore patch level for other packages
274+ match = re.match('^(\d+)\.(\d+)', vers)
275+
276 if match:
277 vers = match.group(0)
278
279@@ -250,13 +257,8 @@
280 # < Liberty co-ordinated project versions
281 try:
282 if 'swift' in pkg.name:
283- swift_vers = vers[:5]
284- if swift_vers not in SWIFT_CODENAMES:
285- # Deal with 1.10.0 upward
286- swift_vers = vers[:6]
287- return SWIFT_CODENAMES[swift_vers]
288+ return SWIFT_CODENAMES[vers]
289 else:
290- vers = vers[:6]
291 return OPENSTACK_CODENAMES[vers]
292 except KeyError:
293 if not fatal:
294@@ -859,7 +861,9 @@
295 if charm_state != 'active' and charm_state != 'unknown':
296 state = workload_state_compare(state, charm_state)
297 if message:
298- message = "{} {}".format(message, charm_message)
299+ charm_message = charm_message.replace("Incomplete relations: ",
300+ "")
301+ message = "{}, {}".format(message, charm_message)
302 else:
303 message = charm_message
304
305
306=== modified file 'charmhelpers/contrib/storage/linux/loopback.py'
307--- charmhelpers/contrib/storage/linux/loopback.py 2015-11-17 17:26:08 +0000
308+++ charmhelpers/contrib/storage/linux/loopback.py 2016-01-07 14:34:44 +0000
309@@ -76,13 +76,3 @@
310 check_call(cmd)
311
312 return create_loopback(path)
313-
314-
315-def is_mapped_loopback_device(device):
316- """
317- Checks if a given device name is an existing/mapped loopback device.
318- :param device: str: Full path to the device (eg, /dev/loop1).
319- :returns: str: Path to the backing file if is a loopback device
320- empty string otherwise
321- """
322- return loopback_devices().get(device, "")
323
324=== modified file 'charmhelpers/core/host.py'
325--- charmhelpers/core/host.py 2015-10-22 13:25:25 +0000
326+++ charmhelpers/core/host.py 2016-01-07 14:34:44 +0000
327@@ -566,7 +566,14 @@
328 os.chdir(cur)
329
330
331-def chownr(path, owner, group, follow_links=True):
332+def chownr(path, owner, group, follow_links=True, chowntopdir=False):
333+ """
334+ Recursively change user and group ownership of files and directories
335+ in given path. Doesn't chown path itself by default, only its children.
336+
337+ :param bool follow_links: Also Chown links if True
338+ :param bool chowntopdir: Also chown path itself if True
339+ """
340 uid = pwd.getpwnam(owner).pw_uid
341 gid = grp.getgrnam(group).gr_gid
342 if follow_links:
343@@ -574,6 +581,10 @@
344 else:
345 chown = os.lchown
346
347+ if chowntopdir:
348+ broken_symlink = os.path.lexists(path) and not os.path.exists(path)
349+ if not broken_symlink:
350+ chown(path, uid, gid)
351 for root, dirs, files in os.walk(path):
352 for name in dirs + files:
353 full = os.path.join(root, name)
354
355=== modified file 'charmhelpers/core/hugepage.py'
356--- charmhelpers/core/hugepage.py 2015-10-22 13:25:25 +0000
357+++ charmhelpers/core/hugepage.py 2016-01-07 14:34:44 +0000
358@@ -46,6 +46,8 @@
359 group_info = add_group(group)
360 gid = group_info.gr_gid
361 add_user_to_group(user, group)
362+ if max_map_count < 2 * nr_hugepages:
363+ max_map_count = 2 * nr_hugepages
364 sysctl_settings = {
365 'vm.nr_hugepages': nr_hugepages,
366 'vm.max_map_count': max_map_count,
367
368=== modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py'
369--- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-10-22 13:25:25 +0000
370+++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2016-01-07 14:34:44 +0000
371@@ -14,12 +14,18 @@
372 # You should have received a copy of the GNU Lesser General Public License
373 # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
374
375+import logging
376+import re
377+import sys
378 import six
379 from collections import OrderedDict
380 from charmhelpers.contrib.amulet.deployment import (
381 AmuletDeployment
382 )
383
384+DEBUG = logging.DEBUG
385+ERROR = logging.ERROR
386+
387
388 class OpenStackAmuletDeployment(AmuletDeployment):
389 """OpenStack amulet deployment.
390@@ -28,9 +34,12 @@
391 that is specifically for use by OpenStack charms.
392 """
393
394- def __init__(self, series=None, openstack=None, source=None, stable=True):
395+ def __init__(self, series=None, openstack=None, source=None,
396+ stable=True, log_level=DEBUG):
397 """Initialize the deployment environment."""
398 super(OpenStackAmuletDeployment, self).__init__(series)
399+ self.log = self.get_logger(level=log_level)
400+ self.log.info('OpenStackAmuletDeployment: init')
401 self.openstack = openstack
402 self.source = source
403 self.stable = stable
404@@ -38,6 +47,22 @@
405 # out.
406 self.current_next = "trusty"
407
408+ def get_logger(self, name="deployment-logger", level=logging.DEBUG):
409+ """Get a logger object that will log to stdout."""
410+ log = logging
411+ logger = log.getLogger(name)
412+ fmt = log.Formatter("%(asctime)s %(funcName)s "
413+ "%(levelname)s: %(message)s")
414+
415+ handler = log.StreamHandler(stream=sys.stdout)
416+ handler.setLevel(level)
417+ handler.setFormatter(fmt)
418+
419+ logger.addHandler(handler)
420+ logger.setLevel(level)
421+
422+ return logger
423+
424 def _determine_branch_locations(self, other_services):
425 """Determine the branch locations for the other services.
426
427@@ -45,6 +70,8 @@
428 stable or next (dev) branch, and based on this, use the corresonding
429 stable or next branches for the other_services."""
430
431+ self.log.info('OpenStackAmuletDeployment: determine branch locations')
432+
433 # Charms outside the lp:~openstack-charmers namespace
434 base_charms = ['mysql', 'mongodb', 'nrpe']
435
436@@ -82,6 +109,8 @@
437
438 def _add_services(self, this_service, other_services):
439 """Add services to the deployment and set openstack-origin/source."""
440+ self.log.info('OpenStackAmuletDeployment: adding services')
441+
442 other_services = self._determine_branch_locations(other_services)
443
444 super(OpenStackAmuletDeployment, self)._add_services(this_service,
445@@ -111,9 +140,79 @@
446
447 def _configure_services(self, configs):
448 """Configure all of the services."""
449+ self.log.info('OpenStackAmuletDeployment: configure services')
450 for service, config in six.iteritems(configs):
451 self.d.configure(service, config)
452
453+ def _auto_wait_for_status(self, message=None, exclude_services=None,
454+ include_only=None, timeout=1800):
455+ """Wait for all units to have a specific extended status, except
456+ for any defined as excluded. Unless specified via message, any
457+ status containing any case of 'ready' will be considered a match.
458+
459+ Examples of message usage:
460+
461+ Wait for all unit status to CONTAIN any case of 'ready' or 'ok':
462+ message = re.compile('.*ready.*|.*ok.*', re.IGNORECASE)
463+
464+ Wait for all units to reach this status (exact match):
465+ message = re.compile('^Unit is ready and clustered$')
466+
467+ Wait for all units to reach any one of these (exact match):
468+ message = re.compile('Unit is ready|OK|Ready')
469+
470+ Wait for at least one unit to reach this status (exact match):
471+ message = {'ready'}
472+
473+ See Amulet's sentry.wait_for_messages() for message usage detail.
474+ https://github.com/juju/amulet/blob/master/amulet/sentry.py
475+
476+ :param message: Expected status match
477+ :param exclude_services: List of juju service names to ignore,
478+ not to be used in conjuction with include_only.
479+ :param include_only: List of juju service names to exclusively check,
480+ not to be used in conjuction with exclude_services.
481+ :param timeout: Maximum time in seconds to wait for status match
482+ :returns: None. Raises if timeout is hit.
483+ """
484+ self.log.info('Waiting for extended status on units...')
485+
486+ all_services = self.d.services.keys()
487+
488+ if exclude_services and include_only:
489+ raise ValueError('exclude_services can not be used '
490+ 'with include_only')
491+
492+ if message:
493+ if isinstance(message, re._pattern_type):
494+ match = message.pattern
495+ else:
496+ match = message
497+
498+ self.log.debug('Custom extended status wait match: '
499+ '{}'.format(match))
500+ else:
501+ self.log.debug('Default extended status wait match: contains '
502+ 'READY (case-insensitive)')
503+ message = re.compile('.*ready.*', re.IGNORECASE)
504+
505+ if exclude_services:
506+ self.log.debug('Excluding services from extended status match: '
507+ '{}'.format(exclude_services))
508+ else:
509+ exclude_services = []
510+
511+ if include_only:
512+ services = include_only
513+ else:
514+ services = list(set(all_services) - set(exclude_services))
515+
516+ self.log.debug('Waiting up to {}s for extended status on services: '
517+ '{}'.format(timeout, services))
518+ service_messages = {service: message for service in services}
519+ self.d.sentry.wait_for_messages(service_messages, timeout=timeout)
520+ self.log.info('OK')
521+
522 def _get_openstack_release(self):
523 """Get openstack release.
524
525
526=== modified file 'tests/charmhelpers/contrib/openstack/amulet/utils.py'
527--- tests/charmhelpers/contrib/openstack/amulet/utils.py 2015-10-22 13:25:25 +0000
528+++ tests/charmhelpers/contrib/openstack/amulet/utils.py 2016-01-07 14:34:44 +0000
529@@ -18,6 +18,7 @@
530 import json
531 import logging
532 import os
533+import re
534 import six
535 import time
536 import urllib
537@@ -604,7 +605,22 @@
538 '{}'.format(sample_type, samples))
539 return None
540
541-# rabbitmq/amqp specific helpers:
542+ # rabbitmq/amqp specific helpers:
543+
544+ def rmq_wait_for_cluster(self, deployment, init_sleep=15, timeout=1200):
545+ """Wait for rmq units extended status to show cluster readiness,
546+ after an optional initial sleep period. Initial sleep is likely
547+ necessary to be effective following a config change, as status
548+ message may not instantly update to non-ready."""
549+
550+ if init_sleep:
551+ time.sleep(init_sleep)
552+
553+ message = re.compile('^Unit is ready and clustered$')
554+ deployment._auto_wait_for_status(message=message,
555+ timeout=timeout,
556+ include_only=['rabbitmq-server'])
557+
558 def add_rmq_test_user(self, sentry_units,
559 username="testuser1", password="changeme"):
560 """Add a test user via the first rmq juju unit, check connection as
561@@ -805,7 +821,10 @@
562 if port:
563 config['ssl_port'] = port
564
565- deployment.configure('rabbitmq-server', config)
566+ deployment.d.configure('rabbitmq-server', config)
567+
568+ # Wait for unit status
569+ self.rmq_wait_for_cluster(deployment)
570
571 # Confirm
572 tries = 0
573@@ -832,7 +851,10 @@
574
575 # Disable RMQ SSL
576 config = {'ssl': 'off'}
577- deployment.configure('rabbitmq-server', config)
578+ deployment.d.configure('rabbitmq-server', config)
579+
580+ # Wait for unit status
581+ self.rmq_wait_for_cluster(deployment)
582
583 # Confirm
584 tries = 0

Subscribers

People subscribed via source and target branches