Merge lp:~thedac/charms/precise/daisy-retracer/sandbox-config into lp:~daisy-pluckers/charms/precise/daisy-retracer/trunk

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

Description of the change

Allow use of the --cleanup-sandbox and --cleanup-debs switches

To post a comment you must log in.
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-12-16 18:37:27 +0000
3+++ config.yaml 2014-12-16 23:14:53 +0000
4@@ -138,6 +138,24 @@
5 If left True, the default use of --sandbox-dir at
6 /srv/$sitename/$instance-type/cache is used by retracer.py. If False,
7 the --nouse-sandbox switch is used.
8+ cleanup-sandbox:
9+ default: False
10+ type: boolean
11+ description: |
12+ If True, retracer.py is run with the --cleanup-sandbox options and will
13+ cleanup the sandbox
14+ /srv/$sitename/$instance-type/cache/$release/cache-xyz/sandbox directory
15+ after each retrace. If left False, retracer.py uses the default behavior
16+ of leaving cached chroot data on disk.
17+ cleanup-debs:
18+ default: False
19+ type: boolean
20+ description: |
21+ If True, retracer.py is run with the --cleanup-debs options and will
22+ cleanup the debs cache
23+ /srv/$sitename/$instance-type/cache/$release/cache-xyz/cache directory
24+ after each retrace. If left False, retracer.py uses the default behavior
25+ of leaving cached debs data on disk.
26 daisy-cassandra-username:
27 type: string
28 default: ''
29
30=== modified file 'hooks/common'
31--- hooks/common 2014-12-16 18:37:27 +0000
32+++ hooks/common 2014-12-16 23:14:53 +0000
33@@ -28,6 +28,9 @@
34 PACKAGE_STATUS="$(config-get package-status)"
35 CACHE_DEBS="$(config-get cache-debs)"
36 SANDBOX="$(config-get sandbox)"
37+CLEANUP_SANDBOX="$(config-get cleanup-sandbox)"
38+CLEANUP_DEBS="$(config-get cleanup-debs)"
39+
40 if [ "$CACHE_DEBS" = "False" ]; then
41 CACHE_DEBS="--nocache-deb"
42 else
43@@ -38,6 +41,16 @@
44 else
45 SANDBOX="--sandbox-dir $CACHE_DIR --nouse-sandbox"
46 fi
47+if [ "$CLEANUP_SANDBOX" = "True" ]; then
48+ CLEANUP_SANDBOX="--cleanup-sandbox"
49+else
50+ CLEANUP_SANDBOX=""
51+fi
52+if [ "$CLEANUP_DEBS" = "True" ]; then
53+ CLEANUP_DEBS="--cleanup-debs"
54+else
55+ CLEANUP_DEBS=""
56+fi
57
58 save_setting () {
59 key="$1"
60@@ -95,7 +108,7 @@
61 export PYTHONPATH
62 env PATH=$APPORT_LOCATION/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
63 export PATH
64-exec $CODE_LOCATION/daisy/retracer.py --config-dir $CODE_LOCATION/retracer/config $SANDBOX --output $LOG_DIR/retracer-$arch.log --architecture $arch $CACHE_DEBS
65+exec $CODE_LOCATION/daisy/retracer.py --config-dir $CODE_LOCATION/retracer/config $SANDBOX --output $LOG_DIR/retracer-$arch.log --architecture $arch $CACHE_DEBS $CLEANUP_SANDBOX $CLEANUP_DEBS
66 EOF
67 juju-log "Starting $arch retracer"
68 start retracer-$arch

Subscribers

People subscribed via source and target branches

to all changes: