Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1787)

Issue 57900043: Get admin_secret from juju-generated jenv file.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by bac
Modified:
10 years, 3 months ago
Reviewers:
frankban, mp+203631
Visibility:
Public.

Description

Get admin_secret from juju-generated jenv file. As of Juju v 1.17 the admin-secret is stored in a generated file, located in $JUJU_HOME/environments/<environment>.jenv. If an admin-secret is provided in environments.yaml, it is used and also stored in the jenv file. If none is given, then juju fabricates one and stores it in the jenv file. The admin-secret *field* is marked as optional now. For the case where a local environment is used, Quickstart previously would generate an admin-secret. That behavior is maintained by forcing 'admin-secret' to be in the missing_fields list. This approach ensures backwards compatibility. Note that the Juju-generated admin-secret is not available until after bootstrapping the environment. Due to this behavior, when using juju v1.16 and not admin-secret is configured in the environments.yaml file, the failure will not be reported until after bootstrapping. This approach seemed better than introducing hard version checking. https://code.launchpad.net/~bac/juju-quickstart/auth/+merge/203631 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 9

Patch Set 2 : Get admin_secret from juju-generated jenv file. #

Patch Set 3 : Get admin_secret from juju-generated jenv file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -35 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M quickstart/app.py View 1 2 chunks +23 lines, -0 lines 0 comments Download
M quickstart/manage.py View 1 5 chunks +20 lines, -5 lines 0 comments Download
M quickstart/models/envs.py View 6 chunks +39 lines, -17 lines 0 comments Download
M quickstart/tests/cli/test_views.py View 2 chunks +2 lines, -2 lines 0 comments Download
M quickstart/tests/models/test_envs.py View 7 chunks +68 lines, -9 lines 0 comments Download
M quickstart/tests/test_app.py View 1 1 chunk +20 lines, -0 lines 0 comments Download
M quickstart/tests/test_manage.py View 1 4 chunks +52 lines, -2 lines 0 comments Download

Messages

Total messages: 4
bac
Please take a look.
10 years, 3 months ago (2014-01-28 20:51:54 UTC) #1
frankban
This branch is nice Brad, thank you. LGTM with minor changes and a less trivial ...
10 years, 3 months ago (2014-01-29 11:48:39 UTC) #2
bac
Please take a look. https://codereview.appspot.com/57900043/diff/1/quickstart/manage.py File quickstart/manage.py (right): https://codereview.appspot.com/57900043/diff/1/quickstart/manage.py#newcode294 quickstart/manage.py:294: At bootstrap, juju (v1.17 and ...
10 years, 3 months ago (2014-01-29 21:10:01 UTC) #3
bac
10 years, 3 months ago (2014-01-29 21:21:09 UTC) #4
*** Submitted:

Get admin_secret from juju-generated jenv file.

As of Juju v 1.17 the admin-secret is stored in a generated file, located in
$JUJU_HOME/environments/<environment>.jenv.

If an admin-secret is provided in environments.yaml, it is used and also
stored in the jenv file.  If none is given, then juju fabricates one and
stores it in the jenv file.

The admin-secret *field* is marked as optional now.  For the case where a
local environment is used, Quickstart previously would generate an
admin-secret.  That behavior is maintained by forcing 'admin-secret' to be in
the missing_fields list.  This approach ensures backwards compatibility.

Note that the Juju-generated admin-secret is not available until after
bootstrapping the environment.  Due to this behavior, when using juju v1.16
and not admin-secret is configured in the environments.yaml file, the failure
will not be reported until after bootstrapping.  This approach seemed better
than introducing hard version checking.

R=frankban
CC=
https://codereview.appspot.com/57900043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b