~sinzui/juju-ci-tools/cloudsigma-lib

« back to all changes in this revision

Viewing changes to utility.py

  • Committer: Aaron Bentley
  • Date: 2015-09-02 20:35:07 UTC
  • mfrom: (1080.1.14 fix-windows-path)
  • Revision ID: aaron.bentley@canonical.com-20150902203507-lqii7p1xo0cxm8mx
Use PATH to specify juju binary on Windows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
 
33
33
@contextmanager
34
 
def scoped_environ():
 
34
def scoped_environ(new_environ=None):
35
35
    old_environ = dict(os.environ)
36
36
    try:
 
37
        if new_environ is not None:
 
38
            os.environ.clear()
 
39
            os.environ.update(new_environ)
37
40
        yield
38
41
    finally:
39
42
        os.environ.clear()