config: empty strings return null with --format=json
Bug #1192706 reported by
James Page
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
Critical
|
Frank Mueller |
Bug Description
Example config.yaml for a charm:
options:
database:
default: ""
type: string
description: empty string
test_two:
type: string
description: no default string
Retrieving these values without setting config:
config-get --format=json database
null
config-get --format=json test_two
null
This is a behavioral change from python juju where the following would happen:
config-get --format=json database
""
config-get --format=json test_two
null
I hit this while testing out some proposed changes to the postgresql charm on juju-core; parsing 'null' results in None in python - parsing "" results in an empty string = #BANG!
Related branches
lp:~dpb/juju-core/1192706-empty-string-config
Rejected
for merging
into
lp:~go-bot/juju-core/trunk
- William Reade (community): Needs Fixing
-
Diff: 37 lines (+3/-5)2 files modifiedcharm/config.go (+0/-2)
charm/config_test.go (+3/-3)
lp:~themue/juju-core/032-config-default-empty-string
- Juju Engineering: Pending requested
-
Diff: 55 lines (+13/-1)2 files modifiedcharm/config.go (+3/-1)
charm/config_test.go (+10/-0)
tags: | added: bitesize cmdline jujud |
Changed in juju-core: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in juju-core: | |
assignee: | nobody → Frank Mueller (themue) |
Changed in juju-core: | |
status: | Triaged → In Progress |
Changed in juju-core: | |
importance: | High → Critical |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Oh - I'm using juju-core built from trunk locally as of today.