Merge lp:~thedac/charms/precise/daisy-retracer/cache-debs into lp:~daisy-pluckers/charms/precise/daisy-retracer/trunk

Proposed by David Ames
Status: Merged
Merged at revision: 75
Proposed branch: lp:~thedac/charms/precise/daisy-retracer/cache-debs
Merge into: lp:~daisy-pluckers/charms/precise/daisy-retracer/trunk
Diff against target: 52 lines (+14/-2)
3 files modified
config.yaml (+7/-0)
hooks/common (+7/-1)
hooks/upgrade-charm (+0/-1)
To merge this branch: bzr merge lp:~thedac/charms/precise/daisy-retracer/cache-debs
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+244225@code.launchpad.net

Description of the change

Add cache-debs configuration to allow the use of --nocache-debs

Also remove superfluous hooks/config-changed call in ugrade-charms hook. The config-changed hook is always run after install and upgrade-charm with modern versions of juju.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

Looks good, thanks!

Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-07-14 22:59:09 +0000
3+++ config.yaml 2014-12-09 21:31:36 +0000
4@@ -124,6 +124,13 @@
5 description: |
6 The maximum amount of free space to use before purging the retracer
7 caches.
8+ cache-debs:
9+ default: True
10+ type: boolean
11+ description: |
12+ If left True, the default caching of deb files to disk is excecuted by
13+ retracer.py. If False, do not cache deb files to disk by passing
14+ --nocache-debs to retracer.py.
15 daisy-cassandra-username:
16 type: string
17 default: ''
18
19=== modified file 'hooks/common'
20--- hooks/common 2014-07-14 21:14:29 +0000
21+++ hooks/common 2014-12-09 21:31:36 +0000
22@@ -24,6 +24,12 @@
23 REGION="$(config-get region)"
24 MAILTO="$(config-get mailto)"
25 MAX_DISK_USAGE_PCT="$(config-get max-disk-usage-pct)"
26+CACHE_DEBS="$(config-get cache-debs))"
27+if [ "$CACHE_DEBS" = "False" ]; then
28+ CACHE_DEBS="--nocache-deb"
29+else
30+ CACHE_DEBS=""
31+fi
32
33 save_setting () {
34 key="$1"
35@@ -81,7 +87,7 @@
36 export PYTHONPATH
37 env PATH=$APPORT_LOCATION/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
38 export PATH
39-exec $CODE_LOCATION/daisy/retracer.py --config-dir $CODE_LOCATION/retracer/config --sandbox-dir $CACHE_DIR --output $LOG_DIR/retracer-$arch.log --architecture $arch
40+exec $CODE_LOCATION/daisy/retracer.py --config-dir $CODE_LOCATION/retracer/config --sandbox-dir $CACHE_DIR --output $LOG_DIR/retracer-$arch.log --architecture $arch $CACHE_DEBS
41 EOF
42 juju-log "Starting $arch retracer"
43 start retracer-$arch
44
45=== modified file 'hooks/upgrade-charm'
46--- hooks/upgrade-charm 2014-12-08 16:09:35 +0000
47+++ hooks/upgrade-charm 2014-12-09 21:31:36 +0000
48@@ -19,4 +19,3 @@
49 cp "$CODE_LOCATION/daisy/configuration.py" "$LOCAL_CONFIG_PATH"
50 # Create version_info.py
51 make -C "$CODE_LOCATION" version
52-hooks/config-changed

Subscribers

People subscribed via source and target branches

to all changes: