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
=== modified file 'jujuclient.py'
--- jujuclient.py 2014-04-27 01:38:13 +0000
+++ jujuclient.py 2014-05-08 23:18:39 +0000
@@ -76,6 +76,15 @@
76log = logging.getLogger("jujuclient")76log = logging.getLogger("jujuclient")
7777
7878
79class EnvironmentNotBootstrapped(Exception):
80
81 def __init__(self, environment):
82 self.environment = environment
83
84 def __str__(self):
85 return "Environment %s is not bootstrapped" % self.environment
86
87
79class AlreadyConnected(Exception):88class AlreadyConnected(Exception):
80 pass89 pass
8190
@@ -323,7 +332,7 @@
323 os.environ.get('JUJU_HOME', '~/.juju'))332 os.environ.get('JUJU_HOME', '~/.juju'))
324 jenv = os.path.join(jhome, 'environments', '%s.jenv' % env_name)333 jenv = os.path.join(jhome, 'environments', '%s.jenv' % env_name)
325 if not os.path.exists(jenv):334 if not os.path.exists(jenv):
326 raise ValueError("Environment %s not bootstrapped" % env_name)335 raise EnvironmentNotBootstrapped(env_name)
327 with open(jenv) as fh:336 with open(jenv) as fh:
328 data = yaml.safe_load(fh.read())337 data = yaml.safe_load(fh.read())
329 cert_path = os.path.join(jhome, '%s.ca')338 cert_path = os.path.join(jhome, '%s.ca')

Subscribers

People subscribed via source and target branches