Merge lp:~cjohnston/uci-engine/1300347 into lp:uci-engine

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 417
Merged at revision: 417
Proposed branch: lp:~cjohnston/uci-engine/1300347
Merge into: lp:uci-engine
Diff against target: 39 lines (+6/-7)
1 file modified
juju-deployer/deploy.py (+6/-7)
To merge this branch: bzr merge lp:~cjohnston/uci-engine/1300347
Reviewer Review Type Date Requested Status
Paul Larson Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+213518@code.launchpad.net

Commit message

Catch DataStore missing/invalid auth info exception

Description of the change

Missing/invalid auth info exception was not caught in the deploy.py code

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:417
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/464/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/464/rebuild

review: Approve (continuous-integration)
Revision history for this message
Paul Larson (pwlars) wrote :

17 - base = os.path.join(os.path.dirname(__file__), '..')
18 print('Preparing local branch upload...')
19
20 - ciutils = os.path.join(base, 'ci-utils')
This means that we would now have to have a current ci_utils installed in order to run deploy, rather than being able to just deploy from branch right? I really like knowing that when I deploy, I'm using the version of ci-utils that is in the branch I'm working from. Is there a reason why you needed to take this out?

review: Needs Information
Revision history for this message
Chris Johnston (cjohnston) wrote :
Revision history for this message
Paul Larson (pwlars) wrote :

You are correct, I was just looking at the mp rather than the whole file. Thanks! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'juju-deployer/deploy.py'
2--- juju-deployer/deploy.py 2014-03-27 13:40:30 +0000
3+++ juju-deployer/deploy.py 2014-03-31 17:15:43 +0000
4@@ -27,7 +27,7 @@
5 deployer_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
6 # ci-utils probably isn't in our pythonpath
7 sys.path.append(os.path.join(os.path.dirname(__file__), '../ci-utils'))
8-from ci_utils import dump_stack
9+from ci_utils import dump_stack, data_store
10
11
12 # Initialize bzrlib and its plugins
13@@ -295,13 +295,8 @@
14 Also set the relevant environment variables used to populate the deployer
15 scripts and charm configurations.
16 """
17- base = os.path.join(os.path.dirname(__file__), '..')
18 print('Preparing local branch upload...')
19
20- ciutils = os.path.join(base, 'ci-utils')
21- sys.path.append(ciutils)
22- from ci_utils import data_store
23-
24 config = {
25 'auth_url': os.environ['OS_AUTH_URL'],
26 'auth_user': os.environ['OS_USERNAME'],
27@@ -309,7 +304,11 @@
28 'auth_tenant_name': os.environ['OS_TENANT_NAME'],
29 'auth_region': os.environ['OS_REGION_NAME']
30 }
31- ds = data_store.DataStore('ci-payload', config, public=True)
32+ try:
33+ ds = data_store.DataStore('ci-payload', config, public=True)
34+ except data_store.DataStoreException as exc:
35+ error_msg = ("ERROR: data-store: {}")
36+ sys.exit(error_msg.format(exc))
37
38 with tempfile.NamedTemporaryFile() as ball:
39 fingerprint = build_payload(ball.name)

Subscribers

People subscribed via source and target branches