Merge lp:~abentley/charms/precise/juju-reports/full-path-ini into lp:~juju-qa/charms/precise/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 28
Proposed branch: lp:~abentley/charms/precise/juju-reports/full-path-ini
Merge into: lp:~juju-qa/charms/precise/juju-reports/trunk
Diff against target: 29 lines (+4/-4)
2 files modified
hooks/common.py (+1/-1)
templates/crontab.tmpl (+3/-3)
To merge this branch: bzr merge lp:~abentley/charms/precise/juju-reports/full-path-ini
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+219228@code.launchpad.net

Description of the change

Always use the production.ini in the project root. Otherwise, scripts invoked from the crontab will use /lib/python2.7/site-packages/jujureports-0.0-py2.7.egg/production.ini

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
=== modified file 'hooks/common.py'
--- hooks/common.py 2014-05-09 16:18:57 +0000
+++ hooks/common.py 2014-05-12 16:11:25 +0000
@@ -54,7 +54,7 @@
5454
55def call_script(script_path):55def call_script(script_path):
56 env = os.environ.copy()56 env = os.environ.copy()
57 ini = os.path.join(PROJECT_DIR, INI)57 ini = get_ini_path()
58 env['HOME'] = HOME58 env['HOME'] = HOME
59 env['INI'] = ini59 env['INI'] = ini
60 subprocess.check_call([script_path], env=env, cwd=PROJECT_DIR)60 subprocess.check_call([script_path], env=env, cwd=PROJECT_DIR)
6161
=== modified file 'templates/crontab.tmpl'
--- templates/crontab.tmpl 2014-05-07 16:03:20 +0000
+++ templates/crontab.tmpl 2014-05-12 16:11:25 +0000
@@ -2,9 +2,9 @@
2PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin2PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
3$error_email3$error_email
44
5*/$interval * * * * ubuntu INI=production.ini $reports_home/bin/python $reports_home/jujureports/jobs/jujuci.py5*/$interval * * * * ubuntu INI=$reports_home/production.ini $reports_home/bin/python $reports_home/jujureports/jobs/jujuci.py
6*/$interval * * * * ubuntu INI=production.ini $reports_home/bin/python $reports_home/jujureports/jobs/charm_testing.py6*/$interval * * * * ubuntu INI=$reports_home/production.ini $reports_home/bin/python $reports_home/jujureports/jobs/charm_testing.py
7# The weekday below should match the value scorecard.collection_day7# The weekday below should match the value scorecard.collection_day
8# in the file production.ini in lp:juju-reports.8# in the file production.ini in lp:juju-reports.
90 16 * * 0 ubuntu INI=production.ini $reports_home/bin/python $reports_home/jujureports/jobs/scorecard.py90 16 * * 0 ubuntu INI=$reports_home/production.ini $reports_home/bin/python $reports_home/jujureports/jobs/scorecard.py
10#0 0 * * 1 ubuntu INI=production.ini $reports_home/bin/python $reports_home/jujureports/jobs/cabs.py10#0 0 * * 1 ubuntu INI=production.ini $reports_home/bin/python $reports_home/jujureports/jobs/cabs.py

Subscribers

People subscribed via source and target branches

to all changes: