Merge lp:~frankban/juju-quickstart/maas into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 100
Proposed branch: lp:~frankban/juju-quickstart/maas
Merge into: lp:juju-quickstart
Diff against target: 107 lines (+54/-3)
4 files modified
quickstart/__init__.py (+1/-1)
quickstart/models/envs.py (+37/-0)
quickstart/settings.py (+2/-2)
quickstart/tests/models/test_envs.py (+14/-0)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/maas
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+236713@code.launchpad.net

Description of the change

Add MAAS support to quickstart.

Also bump version up and update tge default
Juju GUI charm URLs used when charmworld cannot
be contacted.

Tests: `make check`.

QA: already done on a live MAAS instance.
However, it is possible to just try to create
a MAAS environment YAML via the interactive
session.

https://codereview.appspot.com/151200043/

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

Reviewers: mp+236713_code.launchpad.net,

Message:
Please take a look.

Description:
Add MAAS support to quickstart.

Also bump version up and update tge default
Juju GUI charm URLs used when charmworld cannot
be contacted.

Tests: `make check`.

QA: already done on a live MAAS instance.
However, it is possible to just try to create
a MAAS environment YAML via the interactive
session.

https://code.launchpad.net/~frankban/juju-quickstart/maas/+merge/236713

(do not edit description out of merge proposal)

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

Affected files (+55, -3 lines):
   A [revision details]
   M quickstart/__init__.py
   M quickstart/models/envs.py
   M quickstart/settings.py
   M quickstart/tests/models/test_envs.py

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>

Index: quickstart/__init__.py
=== modified file 'quickstart/__init__.py'
--- quickstart/__init__.py 2014-09-11 11:50:53 +0000
+++ quickstart/__init__.py 2014-10-01 13:43:17 +0000
@@ -45,7 +45,7 @@
  Once Juju has been installed, the command can also be run as a juju plugin,
  without the hyphen ("juju quickstart").
  """
-VERSION = (1, 4, 3)
+VERSION = (1, 4, 4)

  def get_version():

Index: quickstart/settings.py
=== modified file 'quickstart/settings.py'
--- quickstart/settings.py 2014-09-01 14:44:39 +0000
+++ quickstart/settings.py 2014-10-01 13:43:17 +0000
@@ -38,8 +38,8 @@
  # temporary connection/charmworld errors.
  # Keep this list sorted by release date (older first).
  DEFAULT_CHARM_URLS = collections.OrderedDict((
- ('precise', 'cs:precise/juju-gui-90'),
- ('trusty', 'cs:trusty/juju-gui-2'),
+ ('precise', 'cs:precise/juju-gui-97'),
+ ('trusty', 'cs:trusty/juju-gui-9'),
  ))

  # The quickstart app short description.

Index: quickstart/models/envs.py
=== modified file 'quickstart/models/envs.py'
--- quickstart/models/envs.py 2014-08-21 16:23:26 +0000
+++ quickstart/models/envs.py 2014-10-01 13:43:17 +0000
@@ -653,6 +653,42 @@
              is_default_field,
          ),
      }
+ env_type_db['maas'] = {
+ 'label': 'MAAS (bare metal)',
+ 'description': (
+ 'Metal As A Service is software which allows you to deal with '
+ 'physical hardware just as easily as virtual nodes. MAAS lets
you '
+ 'treat physical servers like virtual machines in the cloud. '
+ 'Rather than having to manage each server individually, MAAS '
+ 'turns your bare metal into an elastic cloud-like resource. '
+ 'Specifically, MAAS allows for services to be deployed to
bare '
+ 'metal via Juju. '
+ 'See https://juju.ubuntu.com/docs/config-maas.html and '
+ 'http://maas.ubuntu.com/ for more information about MAAS.'
+ ),
+ 'fields': (
+ provider_field,
+ name_field,
+ fields.StringField(
+ 'maa...

Read more...

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

On 2014/10/01 13:48:05, frankban wrote:
> Please take a look.

LGTM. I did the minimal QA and the environments.yaml file looked sane.

Thanks!

https://codereview.appspot.com/151200043/

Revision history for this message
Richard Harding (rharding) wrote :

LGTM with one bit of feedback on the wording. Thanks!

https://codereview.appspot.com/151200043/diff/1/quickstart/models/envs.py
File quickstart/models/envs.py (right):

https://codereview.appspot.com/151200043/diff/1/quickstart/models/envs.py#newcode678
quickstart/models/envs.py:678: help='The MAAS API key. This can be found
by going to the '
I'd tweak this to make it clear it's the 'user preference' dialog vs the
MAAS configuration page. We might even supply a link there like
/MAAS/account/prefs/

https://codereview.appspot.com/151200043/

lp:~frankban/juju-quickstart/maas updated
103. By Francesco Banconi

Improve MAAS API key field description.

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

*** Submitted:

Add MAAS support to quickstart.

Also bump version up and update tge default
Juju GUI charm URLs used when charmworld cannot
be contacted.

Tests: `make check`.

QA: already done on a live MAAS instance.
However, it is possible to just try to create
a MAAS environment YAML via the interactive
session.

R=bac, rharding
CC=
https://codereview.appspot.com/151200043

https://codereview.appspot.com/151200043/

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

Thanks for the reviews!

https://codereview.appspot.com/151200043/diff/1/quickstart/models/envs.py
File quickstart/models/envs.py (right):

https://codereview.appspot.com/151200043/diff/1/quickstart/models/envs.py#newcode678
quickstart/models/envs.py:678: help='The MAAS API key. This can be found
by going to the '
On 2014/10/01 14:52:14, rharding wrote:
> I'd tweak this to make it clear it's the 'user preference' dialog vs
the MAAS
> configuration page. We might even supply a link there like
/MAAS/account/prefs/

Done.

https://codereview.appspot.com/151200043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'quickstart/__init__.py'
2--- quickstart/__init__.py 2014-09-11 11:50:53 +0000
3+++ quickstart/__init__.py 2014-10-01 15:31:15 +0000
4@@ -45,7 +45,7 @@
5 Once Juju has been installed, the command can also be run as a juju plugin,
6 without the hyphen ("juju quickstart").
7 """
8-VERSION = (1, 4, 3)
9+VERSION = (1, 4, 4)
10
11
12 def get_version():
13
14=== modified file 'quickstart/models/envs.py'
15--- quickstart/models/envs.py 2014-08-21 16:23:26 +0000
16+++ quickstart/models/envs.py 2014-10-01 15:31:15 +0000
17@@ -653,6 +653,43 @@
18 is_default_field,
19 ),
20 }
21+ env_type_db['maas'] = {
22+ 'label': 'MAAS (bare metal)',
23+ 'description': (
24+ 'Metal As A Service is software which allows you to deal with '
25+ 'physical hardware just as easily as virtual nodes. MAAS lets you '
26+ 'treat physical servers like virtual machines in the cloud. '
27+ 'Rather than having to manage each server individually, MAAS '
28+ 'turns your bare metal into an elastic cloud-like resource. '
29+ 'Specifically, MAAS allows for services to be deployed to bare '
30+ 'metal via Juju. '
31+ 'See https://juju.ubuntu.com/docs/config-maas.html and '
32+ 'http://maas.ubuntu.com/ for more information about MAAS.'
33+ ),
34+ 'fields': (
35+ provider_field,
36+ name_field,
37+ fields.StringField(
38+ 'maas-server', label='server address', required=True,
39+ help='The MAAS server address, for instance '
40+ 'http://<my-maas-server>/MAAS.'),
41+ fields.PasswordField(
42+ 'maas-oauth', label='API key', required=True,
43+ help='The MAAS API key. This can be found by going to the '
44+ 'MAAS user preferences page (/MAAS/account/prefs/). A '
45+ 'link to the account preferences is accessible from the '
46+ 'drop-down menu that appears when clicking your user '
47+ 'name at the top-right of the page.'),
48+ fields.FilePathField(
49+ 'authorized-keys-path', required=False,
50+ label='SSH public key file',
51+ help='If keys are specified, MAAS will be able to '
52+ 'automatically add them to each unit it manages.'),
53+ admin_secret_field,
54+ default_series_field,
55+ is_default_field,
56+ ),
57+ }
58 env_type_db['local'] = {
59 'label': 'local (LXC)',
60 'description': (
61
62=== modified file 'quickstart/settings.py'
63--- quickstart/settings.py 2014-09-01 14:44:39 +0000
64+++ quickstart/settings.py 2014-10-01 15:31:15 +0000
65@@ -38,8 +38,8 @@
66 # temporary connection/charmworld errors.
67 # Keep this list sorted by release date (older first).
68 DEFAULT_CHARM_URLS = collections.OrderedDict((
69- ('precise', 'cs:precise/juju-gui-90'),
70- ('trusty', 'cs:trusty/juju-gui-2'),
71+ ('precise', 'cs:precise/juju-gui-97'),
72+ ('trusty', 'cs:trusty/juju-gui-9'),
73 ))
74
75 # The quickstart app short description.
76
77=== modified file 'quickstart/tests/models/test_envs.py'
78--- quickstart/tests/models/test_envs.py 2014-08-01 16:28:28 +0000
79+++ quickstart/tests/models/test_envs.py 2014-10-01 15:31:15 +0000
80@@ -806,6 +806,19 @@
81 self.assert_fields(expected, env_metadata)
82 self.assert_required_fields(expected_required, env_metadata)
83
84+ def test_maas_environment(self):
85+ # The MAAS environment metadata includes the expected fields.
86+ self.assertIn('maas', self.env_type_db)
87+ env_metadata = self.env_type_db['maas']
88+ expected = [
89+ 'type', 'name', 'maas-server', 'maas-oauth',
90+ 'authorized-keys-path', 'admin-secret', 'default-series',
91+ 'is-default']
92+ expected_required = [
93+ 'type', 'name', 'maas-server', 'maas-oauth', 'is-default']
94+ self.assert_fields(expected, env_metadata)
95+ self.assert_required_fields(expected_required, env_metadata)
96+
97
98 class TestGetSupportedEnvTypes(unittest.TestCase):
99
100@@ -820,6 +833,7 @@
101 ('openstack', 'OpenStack (or HP Public Cloud)'),
102 ('azure', 'Windows Azure'),
103 ('joyent', 'Joyent'),
104+ ('maas', 'MAAS (bare metal)'),
105 ('local', 'local (LXC)'),
106 ]
107 obtained_env_types = envs.get_supported_env_types(self.env_type_db)

Subscribers

People subscribed via source and target branches