relation_id() fails with multiple relations to the same service

Bug #1593425 reported by Stuart Bishop
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Triaged
Medium
Unassigned

Bug Description

hookenv.relation_id() has the option to specify (relation_name + service_or_unit). This is not a key (the only key for relations is the relation id). If the unit has been related multiple times to the remote service, then relation_id() may return the incorrect relation_id().

eg.

juju deploy local:a
juju deploy local:b
juju add-relation a:rela b:relx
juju add-relation a:relb b:relx

If a unit in service b called relation_id('relx', 'a') it would get one of the two relation ids randomly.

Revision history for this message
Stuart Bishop (stub) wrote :

The only fixes are deprecating and removing the options, or raising an exception and have the charm fail explicitly in this situation (out of its control - it is triggered by how the remote service is implemented).

Changed in charm-helpers:
status: New → Triaged
importance: Undecided → Medium
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.