Merge lp://qastaging/~frankban/juju-quickstart/handle-jenv-envs into lp://qastaging/juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 109
Proposed branch: lp://qastaging/~frankban/juju-quickstart/handle-jenv-envs
Merge into: lp://qastaging/juju-quickstart
Diff against target: 725 lines (+364/-80)
8 files modified
quickstart/app.py (+13/-15)
quickstart/manage.py (+26/-12)
quickstart/models/jenv.py (+85/-7)
quickstart/tests/helpers.py (+49/-9)
quickstart/tests/models/test_jenv.py (+141/-7)
quickstart/tests/test_app.py (+22/-23)
quickstart/tests/test_juju.py (+9/-0)
quickstart/tests/test_manage.py (+19/-7)
To merge this branch: bzr merge lp://qastaging/~frankban/juju-quickstart/handle-jenv-envs
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+244880@code.qastaging.launchpad.net

Description of the change

Promote jenv files as first class envs.

Quickstart no longer refuses to use an environment
which is only present as a jenv file.

Add some more helper functions to the

Also retrieve the environment type, in the case
the environment is already bootstrapped, from
the WebSocket connection and not from the jenv:
jenv files are not assumed to include the type.

Tests: `make check`.

QA:
- use quickstart to bootstrap an environment:
  `.venv/bin/python juju-quickstart`;

- re-run quickstart again to reopen the same environment:
  `.venv/bin/python juju-quickstart`;

- in both cases, check auto-login works and the output
  is sane;

- generate a new environment user and put the
  resulting jenv in your Juju home:
  `juju user add myuser --generate -o ~/.juju/environments/myenv.jenv`;

- use quickstart with the new environment:
  `.venv/bin/python juju-quickstart -e myenv`;

- check that the new credentials are printed to stdout
  and that the auto-login still works;

- destroy the environment.

Thanks a lot!

https://codereview.appspot.com/188300043/

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

Reviewers: mp+244880_code.launchpad.net,

Message:
Please take a look.

Description:
Promote jenv files as first class envs.

Quickstart no longer refuses to use an environment
which is only present as a jenv file.

Add some more helper functions to the

Also retrieve the environment type, in the case
the environment is already bootstrapped, from
the WebSocket connection and not from the jenv:
jenv files are not assumed to include the type.

Tests: `make check`.

QA:
- use quickstart to bootstrap an environment:
   `.venv/bin/python juju-quickstart`;

- re-run quickstart again to reopen the same environment:
   `.venv/bin/python juju-quickstart`;

- in both cases, check auto-login works and the output
   is sane;

- generate a new environment user and put the
   resulting jenv in your Juju home:
   `juju user add myuser --generate -o ~/.juju/environments/myenv.jenv`;

- use quickstart with the new environment:
   `.venv/bin/python juju-quickstart -e myenv`;

- check that the new credentials are printed to stdout
   and that the auto-login still works;

- destroy the environment.

Thanks a lot!

https://code.launchpad.net/~frankban/juju-quickstart/handle-jenv-envs/+merge/244880

(do not edit description out of merge proposal)

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

Affected files (+366, -80 lines):
   A [revision details]
   M quickstart/app.py
   M quickstart/manage.py
   M quickstart/models/jenv.py
   M quickstart/tests/helpers.py
   M quickstart/tests/models/test_jenv.py
   M quickstart/tests/test_app.py
   M quickstart/tests/test_juju.py
   M quickstart/tests/test_manage.py

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

LGTM. WIll QA next.

https://codereview.appspot.com/188300043/diff/1/quickstart/manage.py
File quickstart/manage.py (right):

https://codereview.appspot.com/188300043/diff/1/quickstart/manage.py#newcode241
quickstart/manage.py:241: # If the environment was found in the
environments.yaml file, we can also
This comment seems wrong since we could've come through the second path,
meaning it was not in environments.yaml.

https://codereview.appspot.com/188300043/

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

QA was OK.

Note juju will not let you destroy the environment with the generated
name. If 'local' was originally booted and a mytest.jenv file was
generated by 'juju user add' then 'juju destroy-environment mytest'
prints "removing empty environment file" but does not destroy the
environment.

Not a quickstart issue but interesting.

https://codereview.appspot.com/188300043/

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

Thanks for the reviews!

https://codereview.appspot.com/188300043/diff/1/quickstart/manage.py
File quickstart/manage.py (right):

https://codereview.appspot.com/188300043/diff/1/quickstart/manage.py#newcode241
quickstart/manage.py:241: # If the environment was found in the
environments.yaml file, we can also
On 2014/12/16 17:36:37, bac wrote:
> This comment seems wrong since we could've come through the second
path, meaning
> it was not in environments.yaml.

But this point is never reached in that case: the second path (outer
except block) always returns and exits the function.

https://codereview.appspot.com/188300043/

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

*** Submitted:

Promote jenv files as first class envs.

Quickstart no longer refuses to use an environment
which is only present as a jenv file.

Add some more helper functions to the

Also retrieve the environment type, in the case
the environment is already bootstrapped, from
the WebSocket connection and not from the jenv:
jenv files are not assumed to include the type.

Tests: `make check`.

QA:
- use quickstart to bootstrap an environment:
   `.venv/bin/python juju-quickstart`;

- re-run quickstart again to reopen the same environment:
   `.venv/bin/python juju-quickstart`;

- in both cases, check auto-login works and the output
   is sane;

- generate a new environment user and put the
   resulting jenv in your Juju home:
   `juju user add myuser --generate -o ~/.juju/environments/myenv.jenv`;

- use quickstart with the new environment:
   `.venv/bin/python juju-quickstart -e myenv`;

- check that the new credentials are printed to stdout
   and that the auto-login still works;

- destroy the environment.

Thanks a lot!

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

https://codereview.appspot.com/188300043/

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