ha_relation_joined hook should read from relation_ids('ha') if no IDs are passed through

Bug #1720353 reported by Joseph Borg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Fix Released
High
Unassigned

Bug Description

ha_relation_joined hook should read from relation_ids('ha') if no IDs
are passed through

Proposed patch: https://review.openstack.org/#/c/508507/1/hooks/percona_hooks.py

Tags: cpe-onsite
Ante Karamatić (ivoks)
tags: added: cpe-onsite
David Ames (thedac)
Changed in charm-percona-cluster:
status: New → Confirmed
importance: Undecided → High
milestone: none → 17.11
Revision history for this message
Ante Karamatić (ivoks) wrote :

2017-09-29 12:05:51 DEBUG config-changed ERROR no relation id specified
2017-09-29 12:05:51 DEBUG config-changed Traceback (most recent call last):
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/config-changed", line 777, in <module>
2017-09-29 12:05:51 DEBUG config-changed if __name__ == '__main__':
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/config-changed", line 767, in main
2017-09-29 12:05:51 DEBUG config-changed try:
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/core/hookenv.py", line 768, in execute
2017-09-29 12:05:51 DEBUG config-changed self._hooks[hook_name]()
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/contrib/hardening/harden.py", line 79, in _harden_inner2
2017-09-29 12:05:51 DEBUG config-changed return f(*args, **kwargs)
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/config-changed", line 343, in config_changed
2017-09-29 12:05:51 DEBUG config-changed ha_relation_joined()
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/config-changed", line 664, in ha_relation_joined
2017-09-29 12:05:51 DEBUG config-changed resources=resources,
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/contrib/openstack/ha/utils.py", line 113, in update_dns_ha_resource_params
2017-09-29 12:05:51 DEBUG config-changed 'grp_{}_hostnames'.format(charm_name()): ' '.join(hostname_group)})
2017-09-29 12:05:51 DEBUG config-changed File "/var/lib/juju/agents/unit-mysql-0/charm/hooks/charmhelpers/core/hookenv.py", line 413, in relation_set
2017-09-29 12:05:51 DEBUG config-changed relation_cmd_line + ["--file", settings_file.name])
2017-09-29 12:05:51 DEBUG config-changed File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
2017-09-29 12:05:51 DEBUG config-changed raise CalledProcessError(retcode, cmd)
2017-09-29 12:05:51 DEBUG config-changed subprocess.CalledProcessError: Command '['relation-set', '--file', '/tmp/tmpJW0a7D']' returned non-zero exit status 2
2017-09-29 12:05:51 ERROR juju.worker.uniter.operation runhook.go:107 hook "config-changed" failed: exit status 1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-percona-cluster (master)

Reviewed: https://review.openstack.org/508507
Committed: https://git.openstack.org/cgit/openstack/charm-percona-cluster/commit/?id=373831a6039777e66e7ca2945a63abbf614b6cc7
Submitter: Zuul
Branch: master

commit 373831a6039777e66e7ca2945a63abbf614b6cc7
Author: Joe Borg <email address hidden>
Date: Fri Sep 29 13:45:40 2017 +0100

    Handle ha joined runs out of relation context

    ha_relation_joined was being called in the config-changed hook and not
    passing relation_id information. Pass relation_id when calling
    ha_relation_joined outside of a ha-relation-* hook.

    Closes-Bug: #1720353

    Change-Id: I529d84c51424cbd9cb9ab0298f97516b37c389d6

Changed in charm-percona-cluster:
status: Confirmed → Fix Committed
James Page (james-page)
Changed in charm-percona-cluster:
status: Fix Committed → 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.