relation_get() on a non-set relation setting does not return None
Bug #1203241 reported by
Adam Gandelman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
Fix Released
|
Undecided
|
Jorge Niedbalski |
Bug Description
Not sure if this was ever the expected behavior or if something changed, but calling relation_get() on a non-set relation setting does catch the ValueError from json.loads() and does not return None. Instead, returns an empty string, unlike config() which always returns None for an unset config value:
(Pdb) print config('foobar')
None
(Pdb) print relation_
(Pdb)
Worth noting the inconsistency in output from the relation-get command, using python juju 0.7+bzr628+
# config-get foobar --format=json
null
# relation-get foobar --format=json
""
summary: |
- relation_get() on a non-set relation setting does not return non + relation_get() on a non-set relation setting does not return None |
Changed in charm-helpers: | |
status: | New → Fix Released |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
To post a comment you must log in.