~abentley/charms/precise/juju-reports/charm-bundle-test-token

« back to all changes in this revision

Viewing changes to hooks/common.py

  • Committer: Aaron Bentley
  • Date: 2014-07-22 16:40:47 UTC
  • mfrom: (39.1.1 cbtest-ownership)
  • Revision ID: aaron.bentley@canonical.com-20140722164047-vmztvs0843wp1aj1
Ensure juju-qa-data/cbtest ownership matches home.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    s3config = template.format(access_key=config['aws-access-key'],
63
63
                               secret_key=config['aws-secret-key'])
64
64
    update_file(config_path, s3config)
65
 
    ensure_dir(os.path.join(HOME, 'juju-qa-data'))
66
 
    ensure_dir(os.path.join(HOME, 'juju-qa-data/cbtest'))
 
65
    home_stat = os.stat(HOME)
 
66
    data_path = os.path.join(HOME, 'juju-qa-data')
 
67
    ensure_dir(data_path)
 
68
    os.chown(data_path, home_stat.st_uid, home_stat.st_gid)
 
69
    cbtest_path = os.path.join(HOME, 'juju-qa-data/cbtest')
 
70
    ensure_dir(cbtest_path)
 
71
    os.chown(cbtest_path, home_stat.st_uid, home_stat.st_gid)
67
72
 
68
73
 
69
74
def ensure_dir(path):