ha-relation-joined hook fails in keystone units during tests without VIP configuration

Bug #1825548 reported by David Coronel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Keystone Charm
Fix Released
Undecided
Unassigned

Bug Description

The functional tests (tox -e func) of the keystone charm fail with the following traceback when the VIP IP address is not configured:

unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined Traceback (most recent call last):
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 862, in <module>
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined main()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 855, in main
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined hooks.execute(sys.argv)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/core/hookenv.py", line 914, in execute
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined self._hooks[hook_name]()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 558, in ha_joined
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined settings = generate_ha_relation_data('ks')
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/openstack/ha/utils.py", line 181, in generate_ha_relation_data
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined update_hacluster_vip(service, _relation_data)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/openstack/ha/utils.py", line 280, in update_hacluster_vip
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined cluster_config = get_hacluster_config()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/hahelpers/cluster.py", line 305, in get_hacluster_config
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined if not valid_hacluster_config():
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/hahelpers/cluster.py", line 329, in valid_hacluster_config
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined raise HAIncorrectConfig(msg)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined charmhelpers.contrib.hahelpers.cluster.HAIncorrectConfig: HA: Either vip or dns-ha must be set but not both in order to use high availability
unit-keystone-1: 15:01:42 ERROR juju.worker.uniter.operation hook "ha-relation-joined" failed: exit status 1

This can be fixed by configuring the AMULET_OS_VIP00 environment variable before running the functional tests.

There's a PR in the zaza testing framework (https://github.com/openstack-charmers/zaza/pull/222/) to make template variables mandatory. I think the proper fix would be to use the feature from that PR to make AMULET_OS_VIP00 mandatory.

Revision history for this message
David Coronel (davecore) wrote :

I tested with the https://github.com/openstack-charmers/zaza/pull/222/ PR without setting AMULET_OS_VIP00 and the test fails as expected:

$ tox -e func --workdir /tmp
[...]
INFO:root:Deploying bundle './tests/bundles/trusty-mitaka.yaml' on to 'zaza-946d3f1a24bc' model
ERROR:root:Template error. You may be mmissinga mandatory environment variable : 'AMULET_OS_VIP00' is undefined
ERROR: InvocationError: '/tmp/func/bin/functest-run-suite --keep-model'
[...]
ERROR: func: commands failed

When I set the AMULET_OS_VIP00 var, the test proceeds normally.

I think we can close this bug once that PR is merged.

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

The linked PR has merged

Changed in charm-keystone:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.