Use absolute paths for the context managers. #47

Merged
merged 1 commit into from Aug 26, 2016

Conversation

Projects
None yet
3 participants
Contributor

mbruzek commented Aug 26, 2016

Fixes #45

I noticed that most of the chdir context managers were using relative paths. Make them use absolute paths.

Contributor

mbruzek commented Aug 26, 2016

@jamesbeedy can you have a look at this PR to see if the changes are legit?

- if os.path.isdir('easy-rsa'):
- shutil.rmtree('easy-rsa')
+ # Create an absolute path to easy-rsa that is not affected by cwd.
+ easy_rsa_directory = os.path.join(hookenv.charm_dir(), 'easy-rsa')
@chuckbutler

chuckbutler Aug 26, 2016

Contributor

Nice, i like that you've explicitly called the path here

Contributor

chuckbutler commented Aug 26, 2016

I like that you've refactored paths to be abs paths. Are we certain that these paths won't be changing in the near term? Minor comment, as we would have had the exact same problem with the relative pathing we were using.

+1 LGTM

Contributor

jamesbeedy commented Aug 26, 2016

@mbruzek niceee +1

@mbruzek mbruzek merged commit 0dd76ce into juju-solutions:master Aug 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment