Merge lp://qastaging/~frankban/juju-quickstart/do-not-show-user-prefix into lp://qastaging/juju-quickstart
Proposed by
Francesco Banconi
Status: | Merged |
---|---|
Merged at revision: | 108 |
Proposed branch: | lp://qastaging/~frankban/juju-quickstart/do-not-show-user-prefix |
Merge into: | lp://qastaging/juju-quickstart |
Diff against target: |
203 lines (+47/-22) 6 files modified
quickstart/app.py (+1/-1) quickstart/juju.py (+11/-0) quickstart/models/jenv.py (+9/-7) quickstart/tests/models/test_jenv.py (+4/-3) quickstart/tests/test_app.py (+11/-11) quickstart/tests/test_juju.py (+11/-0) |
To merge this branch: | bzr merge lp://qastaging/~frankban/juju-quickstart/do-not-show-user-prefix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+244842@code.qastaging.launchpad.net |
Description of the change
Do not output the user prefix.
QA:
run quickstart and check that the username
printed to stdout does not include the "srart-"
prefix.
To post a comment you must log in.
Reviewers: mp+244842_ code.launchpad. net,
Message:
Please take a look.
Description:
Do not output the user prefix.
QA:
run quickstart and check that the username
printed to stdout does not include the "srart-"
prefix.
https:/ /code.launchpad .net/~frankban/ juju-quickstart /do-not- show-user- prefix/ +merge/ 244842
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/187320043/
Affected files (+49, -22 lines): models/ jenv.py tests/models/ test_jenv. py tests/test_ app.py tests/test_ juju.py
A [revision details]
M quickstart/app.py
M quickstart/juju.py
M quickstart/
M quickstart/
M quickstart/
M quickstart/
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/app.py e(username, password) msg.format( api_url, err.message))
=== modified file 'quickstart/app.py'
--- quickstart/app.py 2014-12-15 17:31:23 +0000
+++ quickstart/app.py 2014-12-16 11:10:10 +0000
@@ -346,7 +346,7 @@
else:
break
try:
- env.login(password, user=username)
+ env.authenticat
except jujuclient.EnvError as err:
msg = 'unable to log in to the Juju API server on {}: {}'
raise ProgramExit(
Index: quickstart/juju.py juju.py'
=== modified file 'quickstart/
--- quickstart/juju.py 2014-11-12 08:48:35 +0000
+++ quickstart/juju.py 2014-12-16 11:10:10 +0000
@@ -25,6 +25,8 @@
import websocket
+# Define the constant tag used by Juju for user entities. ABNF.OPCODE_ TEXT
+JUJU_USER_TAG = 'user'
OPCODE_TEXT = websocket.
# Define the options used to initiate the secure WebSocket connection.
SSLOPT = {
@@ -50,6 +52,15 @@
deployments to specific machines.
"""
+ def authenticate(self, username, password): }-{}'.format( JUJU_USER_ TAG, username))
+ """Log in into the Juju environment with the given credentials.
+
+ The user name must be provided without the default Juju prefix for
+ users. Use self.login to log in specifying the complete user tag.
+ """
+ return self.login(
+ password, user='{
+
def deploy_bundle(self, yaml, name=None, bundle_id=None):
"""Deploy a bundle."""
params = {'YAML': yaml}
Index: quickstart/ models/ jenv.py models/ jenv.py' models/ jenv.py 2014-12-15 17:31:23 +0000 models/ jenv.py 2014-12-16 11:10:10 +0000
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -31,8 +31,6 @@
)
-# Define the constant tag used by Juju for user entities.
-JUJU_USER_TAG = 'user'
# Define the default Juju user when an environment is initially
bootstrapped.
JUJU_DEFAULT_USER = 'admin'
@@ -70,6 +68,8 @@
"""Return the Juju environment credentials stored in the jenv file.
The credentials are returned as a tuple (username, password).
+ Note that the returned user name is not prefixed with the Juju default
+ prefix for user entities ("user-).
...