Merge lp:~jorge/charms/trusty/juju-gui/add-default-values into lp:charms/trusty/juju-gui

Proposed by Jorge Castro
Status: Needs review
Proposed branch: lp:~jorge/charms/trusty/juju-gui/add-default-values
Merge into: lp:charms/trusty/juju-gui
Diff against target: 32 lines (+4/-0)
1 file modified
config.yaml (+4/-0)
To merge this branch: bzr merge lp:~jorge/charms/trusty/juju-gui/add-default-values
Reviewer Review Type Date Requested Status
Brad Crittenden (community) Needs Information
Review via email: mp+234029@code.launchpad.net

Description of the change

Add default values to pass charm proof.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Thanks for the changes Jorge.

Unfortunately this version does not pass charm-proof, which is a fault of the proofing tool. Running it I see:

[juju-gui]bac@trusty64:~/charms/trusty/juju-gui$ charm-proof .
I: config.yaml: option password has no default value
I: config.yaml: option ssl-key-contents has no default value
I: config.yaml: option ssl-cert-contents has no default value
I: config.yaml: option login-help has no default value

Null should be a valid default value for strings. It is treated as None when parsed in Python. The tool is satisfied if you use:

default: ""

But the empty string is not the same as None. In our charm we have tests like:

if login_help is None: # Use the default value

Setting the default to the empty string causes this test to fail and no login help is shown.

If we insist that a 'default: ' key be provide for each configuration value then the tool should be updated to accept a null value as represented by:

default:
default: null
default: ~

See http://yaml.org/type/null.html for more details.

If the tool is already being updated or you have more information please let me know.

review: Needs Information

Unmerged revisions

98. By Jorge Castro

Add default values to pass charm proof.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-04-15 14:17:12 +0000
3+++ config.yaml 2014-09-09 23:39:59 +0000
4@@ -66,17 +66,20 @@
5 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
6 If not, cetificates will be automatically generated.
7 type: string
8+ default:
9 ssl-key-contents:
10 description: |
11 The contents of the private key file to be used in SSL connections to
12 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
13 If not, cetificates will be automatically generated.
14 type: string
15+ default:
16 login-help:
17 description: |
18 The help text shown to the user on the login screen. If not provided, a
19 default message is used, suggesting how to find the login credentials.
20 type: string
21+ default:
22 read-only:
23 description: |
24 Whether or not the GUI is in read-only mode. Note that read-only mode is
25@@ -103,6 +106,7 @@
26 If given, the password to use for the environment to immediately
27 connect. Do not set unless you understand and accept the risks.
28 type: string
29+ default:
30 sandbox:
31 description: |
32 Run using an in-memory sandbox rather than a real Juju backend. Sandbox

Subscribers

People subscribed via source and target branches