Merge lp:~abentley/juju-ci-tools/pass-juju-home into lp:juju-ci-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 939
Proposed branch: lp:~abentley/juju-ci-tools/pass-juju-home
Merge into: lp:juju-ci-tools
Diff against target: 28 lines (+7/-1)
2 files modified
jujupy.py (+1/-1)
test_jujupy.py (+6/-0)
To merge this branch: bzr merge lp:~abentley/juju-ci-tools/pass-juju-home
Reviewer Review Type Date Requested Status
John George (community) Approve
Review via email: mp+257544@code.launchpad.net

Commit message

Fix bug #1449123 by passing juju_home.

Description of the change

Fix bug #1449123: EnvJujuClient24._shell_environ does not correctly handle juju_home

When adding support for cloudsigma, I accidentally broke support for custom juju_home.

To post a comment you must log in.
933. By Aaron Bentley

Fix bug #1449123 by passing juju_home.

Revision history for this message
John George (jog) wrote :

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jujupy.py'
2--- jujupy.py 2015-04-23 20:44:36 +0000
3+++ jujupy.py 2015-04-27 16:20:08 +0000
4@@ -472,7 +472,7 @@
5
6 Juju's directory must be in the PATH to support plugins.
7 """
8- env = super(EnvJujuClient24, self)._shell_environ()
9+ env = super(EnvJujuClient24, self)._shell_environ(juju_home)
10 if self.env.config.get('type') == 'cloudsigma':
11 env[JUJU_DEV_FEATURE_FLAGS] = 'cloudsigma'
12 return env
13
14=== modified file 'test_jujupy.py'
15--- test_jujupy.py 2015-04-23 20:44:36 +0000
16+++ test_jujupy.py 2015-04-27 16:20:08 +0000
17@@ -95,6 +95,12 @@
18 env = client._shell_environ()
19 self.assertEqual(env[JUJU_DEV_FEATURE_FLAGS], 'cloudsigma')
20
21+ def test__shell_environ_juju_home(self):
22+ client = EnvJujuClient24(
23+ SimpleEnvironment('baz', {'type': 'ec2'}), '1.24-foobar', 'path')
24+ env = client._shell_environ(juju_home='asdf')
25+ self.assertEqual(env['JUJU_HOME'], 'asdf')
26+
27
28 class TestEnvJujuClient(ClientTest):
29

Subscribers

People subscribed via source and target branches