proof complains about null default

Bug #1333598 reported by Stuart Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charm Tools
Fix Committed
Undecided
Unassigned

Bug Description

I use 'default: null' in config.yaml to allow an item to be unspecified. I cannot hard code the default value, as it is chosen at deploy time based on the environment. For example, the default 'version' in the PostgreSQL charm is '9.1' if you are deploying on precise, and '9.3' if you are deploying on trusty. Similarly, the default 'listen_port' is whatever the postgresql package chose to use (probably 5432, but not always).

charm proof complains about these:

$ charm proof
I: config.yaml: option listen_port has no default value
I: config.yaml: option install_sources has no default value
I: config.yaml: option install_keys has no default value
I: config.yaml: option version has no default value

The work around would be to use magic values like "" or -1 to indicate 'unset', although null works just fine everywhere except 'charm proof' and is the correct value to use so I'm considering these spurious warnings. In addition, there is no way to specify a boolean as unset without using null.

Marco Ceppi (marcoceppi)
Changed in charm-tools:
status: New → Fix Committed
milestone: none → 1.4.0
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.