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

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 101
Proposed branch: lp://qastaging/~frankban/juju-quickstart/maas-detect
Merge into: lp://qastaging/juju-quickstart
Diff against target: 494 lines (+345/-12)
7 files modified
quickstart/cli/views.py (+50/-6)
quickstart/maas.py (+59/-0)
quickstart/models/envs.py (+24/-1)
quickstart/settings.py (+3/-0)
quickstart/tests/cli/test_views.py (+76/-5)
quickstart/tests/models/test_envs.py (+35/-0)
quickstart/tests/test_maas.py (+98/-0)
To merge this branch: bzr merge lp://qastaging/~frankban/juju-quickstart/maas-detect
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+237910@code.qastaging.launchpad.net

Description of the change

Support automatic detection of a logged in MAAS.

Automatically detect a logged in MAAS API, so that
it is possible to use the stored credentials to
create and bootstrap a MAAS environment without
user intervention.

QA:
- ssh to the GUI MAAS;
- destroy the existing environment;
- remove the ~/.juju directory;
- use the MAAS UI (http://maas.jujugui.org/MAAS/nodes/)
  to release the nodes if they are not in a ready state;
- this branch is already checked out in ~/juju-quickstart/sandbox/;
- start quickstart from there:
  cd ~/juju-quickstart/sandbox/ && .venv/bin/python juju-quickstart
- quickstart should show the option to automatically create and
  bootstrap the MAAS environment;
- select the option and wait for the envirnment to be ready:
  this can fail due to juju/maas interaction problems we currently
  have, retrying the process should eventually succeed.

Done, thank you!

https://codereview.appspot.com/157830043/

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

Reviewers: mp+237910_code.launchpad.net,

Message:
Please take a look.

Description:
Support automatic detection of a logged in MAAS.

Automatically detect a logged in MAAS API, so that
it is possible to use the stored credentials to
create and bootstrap a MAAS environment without
user intervention.

QA:
- ssh to the GUI MAAS;
- destroy the existing environment;
- remove the ~/.juju directory;
- use the MAAS UI (http://maas.jujugui.org/MAAS/nodes/)
   to release the nodes if they are not in a ready state;
- this branch is already checked out in ~/juju-quickstart/sandbox/;
- start quickstart from there:
   cd ~/juju-quickstart/sandbox/ && .venv/bin/python juju-quickstart
- quickstart should show the option to automatically create and
   bootstrap the MAAS environment;
- select the option and wait for the envirnment to be ready:
   this can fail due to juju/maas interaction problems we currently
   have, retrying the process should eventually succeed.

Done, thank you!

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

(do not edit description out of merge proposal)

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

Affected files (+347, -12 lines):
   A [revision details]
   M quickstart/cli/views.py
   A quickstart/maas.py
   M quickstart/models/envs.py
   M quickstart/settings.py
   M quickstart/tests/cli/test_views.py
   M quickstart/tests/models/test_envs.py
   A quickstart/tests/test_maas.py

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

On 2014/10/10 08:03:44, frankban wrote:
> Please take a look.

LGTM Francesco, with a few little comments. Thanks!

https://codereview.appspot.com/157830043/

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

LGTM

https://codereview.appspot.com/157830043/diff/1/quickstart/maas.py
File quickstart/maas.py (right):

https://codereview.appspot.com/157830043/diff/1/quickstart/maas.py#newcode42
quickstart/maas.py:42: Return None if if no authenticated API is found.
s/if if/if/

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

https://codereview.appspot.com/157830043/diff/1/quickstart/models/envs.py#newcode388
quickstart/models/envs.py:388: # Assume all missing fields can be
automatically generated.
What happens if this assumption is wrong? Will field.generate() raise an
error?

https://codereview.appspot.com/157830043/diff/1/quickstart/tests/cli/test_views.py
File quickstart/tests/cli/test_views.py (right):

https://codereview.appspot.com/157830043/diff/1/quickstart/tests/cli/test_views.py#newcode64
quickstart/tests/cli/test_views.py:64: default values: "maas-user",
"http://1.2.3.4/MAAS" and "maas-secret".
Maybe not repeat the values set above but just reference them? I reckon
DRY should apply to comments too.

https://codereview.appspot.com/157830043/

111. By Francesco Banconi

Fixt a typo and improve test comments.

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

Please take a look.

https://codereview.appspot.com/157830043/diff/1/quickstart/maas.py
File quickstart/maas.py (right):

https://codereview.appspot.com/157830043/diff/1/quickstart/maas.py#newcode42
quickstart/maas.py:42: Return None if if no authenticated API is found.
On 2014/10/10 08:48:53, bac wrote:
> s/if if/if/

Done.

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

https://codereview.appspot.com/157830043/diff/1/quickstart/models/envs.py#newcode388
quickstart/models/envs.py:388: # Assume all missing fields can be
automatically generated.
On 2014/10/10 08:48:53, bac wrote:
> What happens if this assumption is wrong? Will field.generate() raise
an error?

A field without the ability to automatically generate a value does not
have the generate method. So the above call would raise an
AttributeError.

https://codereview.appspot.com/157830043/diff/1/quickstart/tests/cli/test_views.py
File quickstart/tests/cli/test_views.py (right):

https://codereview.appspot.com/157830043/diff/1/quickstart/tests/cli/test_views.py#newcode64
quickstart/tests/cli/test_views.py:64: default values: "maas-user",
"http://1.2.3.4/MAAS" and "maas-secret".
On 2014/10/10 08:48:53, bac wrote:
> Maybe not repeat the values set above but just reference them? I
reckon DRY
> should apply to comments too.

Done.

https://codereview.appspot.com/157830043/

Revision history for this message
Jay R. Wren (evarlast) wrote :
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Support automatic detection of a logged in MAAS.

Automatically detect a logged in MAAS API, so that
it is possible to use the stored credentials to
create and bootstrap a MAAS environment without
user intervention.

QA:
- ssh to the GUI MAAS;
- destroy the existing environment;
- remove the ~/.juju directory;
- use the MAAS UI (http://maas.jujugui.org/MAAS/nodes/)
   to release the nodes if they are not in a ready state;
- this branch is already checked out in ~/juju-quickstart/sandbox/;
- start quickstart from there:
   cd ~/juju-quickstart/sandbox/ && .venv/bin/python juju-quickstart
- quickstart should show the option to automatically create and
   bootstrap the MAAS environment;
- select the option and wait for the envirnment to be ready:
   this can fail due to juju/maas interaction problems we currently
   have, retrying the process should eventually succeed.

Done, thank you!

R=bac, jay.wren
CC=
https://codereview.appspot.com/157830043

https://codereview.appspot.com/157830043/

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches