Merge lp:~abentley/charms/precise/juju-reports/cbtest-ownership into lp:~juju-qa/charms/precise/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 40
Proposed branch: lp:~abentley/charms/precise/juju-reports/cbtest-ownership
Merge into: lp:~juju-qa/charms/precise/juju-reports/trunk
Diff against target: 19 lines (+7/-2)
1 file modified
hooks/common.py (+7/-2)
To merge this branch: bzr merge lp:~abentley/charms/precise/juju-reports/cbtest-ownership
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+227786@code.launchpad.net

Commit message

Ensure juju-qa-data/cbtest ownership matches home.

Description of the change

Since hooks run as root, juju-qa-data/cbtest was being created as a root-owned directory. This fixes that.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/common.py'
2--- hooks/common.py 2014-07-18 20:19:59 +0000
3+++ hooks/common.py 2014-07-22 16:36:38 +0000
4@@ -62,8 +62,13 @@
5 s3config = template.format(access_key=config['aws-access-key'],
6 secret_key=config['aws-secret-key'])
7 update_file(config_path, s3config)
8- ensure_dir(os.path.join(HOME, 'juju-qa-data'))
9- ensure_dir(os.path.join(HOME, 'juju-qa-data/cbtest'))
10+ home_stat = os.stat(HOME)
11+ data_path = os.path.join(HOME, 'juju-qa-data')
12+ ensure_dir(data_path)
13+ os.chown(data_path, home_stat.st_uid, home_stat.st_gid)
14+ cbtest_path = os.path.join(HOME, 'juju-qa-data/cbtest')
15+ ensure_dir(cbtest_path)
16+ os.chown(cbtest_path, home_stat.st_uid, home_stat.st_gid)
17
18
19 def ensure_dir(path):

Subscribers

People subscribed via source and target branches

to all changes: