Hyphens in RelationContext.name unsupported

Bug #1457619 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
In Progress
Undecided
Unassigned

Bug Description

It's customary to include hyphens/dashes in relation names, but that means the context for a template in ServiceManager ends up as:

> {
> 'relation-name': {
> 'key': 'value',
> ...
> }
> }

This, then, means that in the template you'd want to go:

> {{ relation-name['key'] }}

But that won't work, because it's trying to subtract name from relation.

One approach would be to put all the relation contexts under a common key, changing the template to, for example:

> {{ ctx['relation-name']['key'] }}

Another would be to sanitize the relation names, or maybe an optional RelationContext.alias that would be used in the context?

Related branches

Michał Sawicz (saviq)
Changed in charm-helpers:
status: New → In Progress
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.