Merge lp:~frankban/juju-quickstart/optional-fields into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 129
Proposed branch: lp:~frankban/juju-quickstart/optional-fields
Merge into: lp:juju-quickstart
Diff against target: 293 lines (+73/-35)
4 files modified
quickstart/cli/forms.py (+2/-1)
quickstart/models/envs.py (+56/-19)
quickstart/tests/models/test_envs.py (+11/-11)
tox.ini (+4/-4)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/optional-fields
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+257913@code.launchpad.net

Description of the change

Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

https://codereview.appspot.com/234150043/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+257913_code.launchpad.net,

Message:
Please take a look.

Description:
Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

https://code.launchpad.net/~frankban/juju-quickstart/optional-fields/+merge/257913

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/234150043/

Affected files (+75, -35 lines):
   A [revision details]
   M quickstart/cli/forms.py
   M quickstart/models/envs.py
   M quickstart/tests/models/test_envs.py
   M tox.ini

Revision history for this message
Brad Crittenden (bac) wrote :

I can no longer login to Reitveld.

Code looks good. QA was fine.

review: Approve (code)
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

R=
CC=
https://codereview.appspot.com/234150043

https://codereview.appspot.com/234150043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'quickstart/cli/forms.py'
2--- quickstart/cli/forms.py 2014-01-14 15:50:10 +0000
3+++ quickstart/cli/forms.py 2015-04-30 15:41:36 +0000
4@@ -168,7 +168,8 @@
5 # Unset values are converted to a more convenient value for the
6 # checkbox (a boolean or a mixed state if allowed by the field).
7 value = MIXED if field.allow_mixed else bool(field.default)
8- label = ('highlight', field.label)
9+ caption_class = 'highlight' if field.required else 'optional'
10+ label = (caption_class, field.label)
11 widget = urwid.CheckBox(label, state=value, has_mixed=field.allow_mixed)
12 widgets = []
13 if error:
14
15=== modified file 'quickstart/models/envs.py'
16--- quickstart/models/envs.py 2014-11-13 08:56:19 +0000
17+++ quickstart/models/envs.py 2015-04-30 15:41:36 +0000
18@@ -407,6 +407,12 @@
19 is_default_field = fields.BoolField(
20 'is-default', label='default', allow_mixed=False, required=True,
21 help='make this the default environment')
22+ image_stream_field = fields.SuggestionsStringField(
23+ 'image-stream', label='image stream', required=False,
24+ help='A simplestreams stream to select OS images from. For example '
25+ 'daily or released images (or any other stream available on '
26+ 'simplestreams).',
27+ suggestions=['released', 'daily'])
28 # Define data structures used as part of the metadata below.
29 ec2_regions = (
30 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2',
31@@ -432,7 +438,7 @@
32 '__fallback__': {
33 'description': (
34 'This provider type is not supported by quickstart. '
35- 'See https://juju.ubuntu.com/docs/getting-started.html for '
36+ 'See https://jujucharms.com/docs/stable/getting-started for '
37 'a description of how to get started with Juju.'
38 ),
39 'fields': (
40@@ -451,7 +457,7 @@
41 'This process requires you to have an Amazon Web Services (AWS) '
42 'account. If you have not signed up for one yet, it can obtained '
43 'at http://aws.amazon.com. '
44- 'See https://juju.ubuntu.com/docs/config-aws.html for more '
45+ 'See https://jujucharms.com/docs/stable/config-aws for more '
46 'details on the ec2 provider configuration.'
47 ),
48 'fields': (
49@@ -478,6 +484,7 @@
50 fields.ChoiceField(
51 'region', choices=ec2_regions, default='us-east-1',
52 label='region', required=False, help='the ec2 region to use'),
53+ image_stream_field,
54 admin_secret_field,
55 default_series_field,
56 fields.AutoGeneratedStringField(
57@@ -492,8 +499,8 @@
58 'The openstack provider enables you to run Juju on OpenStack '
59 'private and public clouds. Use this also if you want to '
60 'set up Juju on HP Public Cloud. See '
61- 'https://juju.ubuntu.com/docs/config-openstack.html and '
62- 'https://juju.ubuntu.com/docs/config-hpcloud.html for more '
63+ 'https://jujucharms.com/docs/stable/config-openstack and '
64+ 'https://jujucharms.com/docs/stable/config-hpcloud for more '
65 'details on the openstack provider configuration.'
66 ),
67 'fields': (
68@@ -506,25 +513,31 @@
69 'For HP Public Cloud, use the value suggested below:',
70 suggestions=['https://region-a.geo-1.identity.hpcloudsvc.com'
71 ':35357/v2.0/']),
72- fields.StringField(
73- 'tenant-name', label='tenant name', required=True,
74- help='The OpenStack tenant name. For HP Public Cloud, this is '
75- 'listed as the project name on the '
76- 'https://horizon.hpcloud.com/landing/ page.'),
77+ # Optional fields.
78 fields.BoolField(
79- 'use-floating-ip', label='use floating IP', allow_mixed=False,
80- required=True,
81+ 'use-floating-ip', label='use floating IP', allow_mixed=True,
82+ required=False,
83 help='Specifies whether the use of a floating IP address is '
84 'required to give the nodes a public IP address. '
85 'Some installations assign public IP addresses by '
86 'default without requiring a floating IP address. '
87 'For HP Public Cloud, floating IP must be activated.'),
88+ fields.BoolField(
89+ 'use-default-secgroup', label='use default security group',
90+ allow_mixed=True, required=False,
91+ help='Specifies whether new machine instances should have the '
92+ '"default" OpenStack security group assigned. It '
93+ 'defaults to false.'),
94+ fields.StringField(
95+ 'tenant-name', label='tenant name', required=False,
96+ help='The OpenStack tenant name. For HP Public Cloud, this is '
97+ 'listed as the project name on the '
98+ 'https://horizon.hpcloud.com/landing/ page.'),
99 fields.SuggestionsStringField(
100- 'region', label='region', required=True,
101+ 'region', label='region', required=False,
102 help='The OpenStack region to use. '
103 'For HP Public Cloud, use one of the following:',
104 suggestions=hp_regions),
105- # Optional fields.
106 fields.ChoiceField(
107 'auth-mode', label='authentication mode', required=False,
108 default='userpass', choices=('userpass', 'keypair'),
109@@ -548,6 +561,19 @@
110 fields.PasswordField(
111 'secret-key', label='secret key', required=False,
112 help='the secret key to use for the keypair authentication'),
113+ fields.StringField(
114+ 'tools-metadata-url', label='tools metadata URL',
115+ required=False,
116+ help='The location of the Juju tools and metadata. It '
117+ 'defaults to the global public tools metadata location '
118+ 'https://streams.canonical.com/tools'),
119+ fields.StringField(
120+ 'image-metadata-url', label='image metadata URL',
121+ required=False,
122+ help='The location of Ubuntu cloud image metadata. It '
123+ 'defaults to the global public image metadata location '
124+ 'https://cloud-images.ubuntu.com/releases'),
125+ image_stream_field,
126 fields.AutoGeneratedStringField(
127 'control-bucket', label='control bucket', required=False,
128 help='the globally unique swift bucket name'),
129@@ -563,7 +589,7 @@
130 'It requires you to have an Windows Azure account. If you have '
131 'not signed up for one yet, it can obtained at '
132 'http://www.windowsazure.com/. See '
133- 'https://juju.ubuntu.com/docs/config-azure.html for more '
134+ 'https://jujucharms.com/docs/stable/config-azure for more '
135 'details on the azure provider configuration.'
136 ),
137 'fields': (
138@@ -594,6 +620,7 @@
139 'location', choices=azure_locations, label='location',
140 required=True, help='the region to use'),
141 # Optional fields.
142+ image_stream_field,
143 admin_secret_field,
144 default_series_field,
145 is_default_field,
146@@ -606,8 +633,8 @@
147 'This process requires you to have a Joyent account. If you have '
148 'not signed up for one yet, it can obtained at '
149 'http://www.joyent.com/. See '
150- 'https://juju.ubuntu.com/docs/config-joyent.html for more details '
151- 'on the joyent provider configuration.'
152+ 'https://jujucharms.com/docs/stable/config-joyent for more '
153+ 'details on the joyent provider configuration.'
154 ),
155 'fields': (
156 provider_field,
157@@ -666,7 +693,7 @@
158 'turns your bare metal into an elastic cloud-like resource. '
159 'Specifically, MAAS allows for services to be deployed to bare '
160 'metal via Juju. '
161- 'See https://juju.ubuntu.com/docs/config-maas.html and '
162+ 'See https://jujucharms.com/docs/stable/config-maas and '
163 'http://maas.ubuntu.com/ for more information about MAAS.'
164 ),
165 'fields': (
166@@ -685,6 +712,16 @@
167 'drop-down menu that appears when clicking your user '
168 'name at the top-right of the page.'),
169 # Optional fields.
170+ fields.BoolField(
171+ 'disable-network-management',
172+ label='disable Juju network management',
173+ allow_mixed=True, required=False,
174+ help='Enable this when MAAS is managing the bridge and '
175+ 'bringing networks up and down. This tells Juju not to '
176+ 'create a network bridge or to bring eth0 up and down '
177+ 'during the cloud-init install phase. Juju will not make '
178+ 'changes to the network configuration when its agents '
179+ 'start.'),
180 fields.FilePathField(
181 'authorized-keys-path', required=False,
182 label='SSH public key file',
183@@ -707,7 +744,7 @@
184 'options. Manual provisioning enables you to run Juju on systems '
185 'that have a supported operating system installed. You will need '
186 'to ensure that you have both SSH access and sudo rights. '
187- 'See https://juju.ubuntu.com/docs/config-manual.html for more '
188+ 'See https://jujucharms.com/docs/stable/config-manual for more '
189 'details on the manual provider configuration, including its '
190 'caveats and limitattions.'
191 ),
192@@ -743,7 +780,7 @@
193 'description': (
194 'The LXC local provider enables you to run Juju on a single '
195 'system like your local computer or a single server. '
196- 'See https://juju.ubuntu.com/docs/config-LXC.html for more '
197+ 'See https://jujucharms.com/docs/stable/config-LXC for more '
198 'details on the local provider configuration.'
199 ),
200 'fields': (
201
202=== modified file 'quickstart/tests/models/test_envs.py'
203--- quickstart/tests/models/test_envs.py 2015-02-09 10:38:25 +0000
204+++ quickstart/tests/models/test_envs.py 2015-04-30 15:41:36 +0000
205@@ -712,7 +712,8 @@
206 env_metadata = self.env_type_db['ec2']
207 expected = [
208 'type', 'name', 'access-key', 'secret-key', 'region',
209- 'admin-secret', 'default-series', 'control-bucket', 'is-default']
210+ 'image-stream', 'admin-secret', 'default-series', 'control-bucket',
211+ 'is-default']
212 expected_required = [
213 'type', 'name', 'access-key', 'secret-key',
214 'is-default']
215@@ -724,13 +725,12 @@
216 self.assertIn('openstack', self.env_type_db)
217 env_metadata = self.env_type_db['openstack']
218 expected = [
219- 'type', 'name', 'auth-url', 'tenant-name', 'use-floating-ip',
220- 'region', 'auth-mode', 'username', 'password', 'access-key',
221- 'secret-key', 'control-bucket', 'admin-secret', 'default-series',
222- 'is-default']
223- expected_required = [
224- 'type', 'name', 'auth-url', 'tenant-name', 'use-floating-ip',
225- 'region', 'is-default']
226+ 'type', 'name', 'auth-url', 'use-floating-ip',
227+ 'use-default-secgroup', 'tenant-name', 'region', 'auth-mode',
228+ 'username', 'password', 'access-key', 'secret-key',
229+ 'tools-metadata-url', 'image-metadata-url', 'image-stream',
230+ 'control-bucket', 'admin-secret', 'default-series', 'is-default']
231+ expected_required = ['type', 'name', 'auth-url', 'is-default']
232 self.assert_fields(expected, env_metadata)
233 self.assert_required_fields(expected_required, env_metadata)
234
235@@ -741,7 +741,7 @@
236 expected = [
237 'type', 'name', 'management-subscription-id',
238 'management-certificate-path', 'storage-account-name', 'location',
239- 'admin-secret', 'default-series', 'is-default']
240+ 'image-stream', 'admin-secret', 'default-series', 'is-default']
241 expected_required = [
242 'type', 'name', 'management-subscription-id',
243 'management-certificate-path', 'storage-account-name', 'location',
244@@ -769,8 +769,8 @@
245 env_metadata = self.env_type_db['maas']
246 expected = [
247 'type', 'name', 'maas-server', 'maas-oauth',
248- 'authorized-keys-path', 'admin-secret', 'default-series',
249- 'is-default']
250+ 'disable-network-management', 'authorized-keys-path',
251+ 'admin-secret', 'default-series', 'is-default']
252 expected_required = [
253 'type', 'name', 'maas-server', 'maas-oauth', 'is-default']
254 self.assert_fields(expected, env_metadata)
255
256=== modified file 'tox.ini'
257--- tox.ini 2015-04-28 15:25:14 +0000
258+++ tox.ini 2015-04-30 15:41:36 +0000
259@@ -72,7 +72,7 @@
260 # See https://launchpad.net/~juju/+archive/ubuntu/stable.
261 websocket-client==0.18.0
262 jujuclient==0.50.1
263- jujubundlelib==0.1.5
264+ jujubundlelib==0.1.6
265 urwid==1.2.1
266 # The distribution PyYAML requirement is used in this case.
267
268@@ -82,7 +82,7 @@
269 # Ubuntu 14.04 (trusty) distro dependencies.
270 websocket-client==0.12.0
271 jujuclient==0.17.5
272- jujubundlelib==0.1.5
273+ jujubundlelib==0.1.6
274 PyYAML==3.10
275 urwid==1.1.1
276
277@@ -92,7 +92,7 @@
278 # Ubuntu 14.10 (utopic) distro dependencies.
279 websocket-client==0.12.0
280 jujuclient==0.17.5
281- jujubundlelib==0.1.5
282+ jujubundlelib==0.1.6
283 PyYAML==3.11
284 urwid==1.2.1
285
286@@ -102,7 +102,7 @@
287 # Ubuntu 15.04 (vivid) distro dependencies.
288 websocket-client==0.18.0
289 jujuclient==0.18.5
290- jujubundlelib==0.1.5
291+ jujubundlelib==0.1.6
292 PyYAML==3.11
293 urwid==1.2.1
294

Subscribers

People subscribed via source and target branches