Merge lp:~joetalbott/charms/trusty/adt-image-mapper/fix_service_dir into lp:~canonical-ci-engineering/charms/trusty/adt-image-mapper/trunk

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 6
Merged at revision: 6
Proposed branch: lp:~joetalbott/charms/trusty/adt-image-mapper/fix_service_dir
Merge into: lp:~canonical-ci-engineering/charms/trusty/adt-image-mapper/trunk
Diff against target: 34 lines (+5/-2)
1 file modified
hooks/actions.py (+5/-2)
To merge this branch: bzr merge lp:~joetalbott/charms/trusty/adt-image-mapper/fix_service_dir
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Review via email: mp+253534@code.launchpad.net

Commit message

Get the config before we access the config.

* minor PEP8 fixes as well.

Description of the change

Get the config before we access the config.

* minor PEP8 fixes as well.

To post a comment you must log in.
Revision history for this message
Francis Ginther (fginther) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-03-19 15:46:32 +0000
3+++ hooks/actions.py 2015-03-19 16:11:44 +0000
4@@ -14,18 +14,20 @@
5 REQUIRED_PACKAGES = [
6 'python-virtualenv', 'python3-dev', 'libssl-dev', 'libffi-dev',
7 ]
8+
9+config = hookenv.config()
10+
11 SERVICE_DIR = '/srv/{}/adt-image-mapper'.format(config['environment'])
12 LOG_DIR = os.path.join(SERVICE_DIR, 'logs')
13 WSGI_USER = 'www-data'
14 WSGI_GROUP = 'www-data'
15
16-config = hookenv.config()
17-
18
19 def basenode(service_name):
20 hookenv.log("Executing basenode")
21 execd.execd_preinstall()
22
23+
24 def log_start(service_name):
25 hookenv.log('adt-image-mapper starting')
26
27@@ -74,6 +76,7 @@
28 subprocess.check_call(['%s/bin/pip' % env_dir,
29 'install', '--no-deps', '-e', SERVICE_DIR])
30
31+
32 def prepare_for_wsgi(service_name):
33 host.adduser(WSGI_USER)
34 host.add_group(WSGI_GROUP)

Subscribers

People subscribed via source and target branches