Hyphens in RelationContext.name unsupported
Bug #1457619 reported by
Michał Sawicz
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-
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-
Another would be to sanitize the relation names, or maybe an optional RelationContext
Related branches
lp:~johnsca/charm-helpers/hyphen-relations
- Stuart Bishop (community): Approve
-
Diff: 35 lines (+4/-3)2 files modifiedcharmhelpers/core/services/helpers.py (+2/-1)
tests/core/test_services.py (+2/-2)
Changed in charm-helpers: | |
status: | New → In Progress |
To post a comment you must log in.