Merge lp:~niedbalski/python-jujuclient/trunk into lp:~hazmat/python-jujuclient/trunk

Proposed by Jorge Niedbalski
Status: Needs review
Proposed branch: lp:~niedbalski/python-jujuclient/trunk
Merge into: lp:~hazmat/python-jujuclient/trunk
Diff against target: 28 lines (+10/-1)
1 file modified
jujuclient.py (+10/-1)
To merge this branch: bzr merge lp:~niedbalski/python-jujuclient/trunk
Reviewer Review Type Date Requested Status
Kapil Thangavelu Pending
Review via email: mp+218895@code.launchpad.net

Description of the change

Added EnvironmentNotBootstrapped Exception, instead of raising a ValueError.

To post a comment you must log in.

Unmerged revisions

35. By Jorge Niedbalski

Added EnvironmentNotBootstrapped instead of raising ValueError

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jujuclient.py'
2--- jujuclient.py 2014-04-27 01:38:13 +0000
3+++ jujuclient.py 2014-05-08 23:18:39 +0000
4@@ -76,6 +76,15 @@
5 log = logging.getLogger("jujuclient")
6
7
8+class EnvironmentNotBootstrapped(Exception):
9+
10+ def __init__(self, environment):
11+ self.environment = environment
12+
13+ def __str__(self):
14+ return "Environment %s is not bootstrapped" % self.environment
15+
16+
17 class AlreadyConnected(Exception):
18 pass
19
20@@ -323,7 +332,7 @@
21 os.environ.get('JUJU_HOME', '~/.juju'))
22 jenv = os.path.join(jhome, 'environments', '%s.jenv' % env_name)
23 if not os.path.exists(jenv):
24- raise ValueError("Environment %s not bootstrapped" % env_name)
25+ raise EnvironmentNotBootstrapped(env_name)
26 with open(jenv) as fh:
27 data = yaml.safe_load(fh.read())
28 cert_path = os.path.join(jhome, '%s.ca')

Subscribers

People subscribed via source and target branches