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
=== modified file 'config.yaml'
--- config.yaml 2014-04-15 14:17:12 +0000
+++ config.yaml 2014-09-09 23:39:59 +0000
@@ -66,17 +66,20 @@
66 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.66 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
67 If not, cetificates will be automatically generated.67 If not, cetificates will be automatically generated.
68 type: string68 type: string
69 default:
69 ssl-key-contents:70 ssl-key-contents:
70 description: |71 description: |
71 The contents of the private key file to be used in SSL connections to72 The contents of the private key file to be used in SSL connections to
72 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.73 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
73 If not, cetificates will be automatically generated.74 If not, cetificates will be automatically generated.
74 type: string75 type: string
76 default:
75 login-help:77 login-help:
76 description: |78 description: |
77 The help text shown to the user on the login screen. If not provided, a79 The help text shown to the user on the login screen. If not provided, a
78 default message is used, suggesting how to find the login credentials.80 default message is used, suggesting how to find the login credentials.
79 type: string81 type: string
82 default:
80 read-only:83 read-only:
81 description: |84 description: |
82 Whether or not the GUI is in read-only mode. Note that read-only mode is85 Whether or not the GUI is in read-only mode. Note that read-only mode is
@@ -103,6 +106,7 @@
103 If given, the password to use for the environment to immediately106 If given, the password to use for the environment to immediately
104 connect. Do not set unless you understand and accept the risks.107 connect. Do not set unless you understand and accept the risks.
105 type: string108 type: string
109 default:
106 sandbox:110 sandbox:
107 description: |111 description: |
108 Run using an in-memory sandbox rather than a real Juju backend. Sandbox112 Run using an in-memory sandbox rather than a real Juju backend. Sandbox

Subscribers

People subscribed via source and target branches