Merge lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281 into lp:orange-box

Proposed by Darryl Weaver
Status: Merged
Merged at revision: 504
Proposed branch: lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281
Merge into: lp:orange-box
Diff against target: 65 lines (+35/-10)
1 file modified
usr/bin/orange-box-sync-charmstore (+35/-10)
To merge this branch: bzr merge lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+237406@code.launchpad.net

Description of the change

Fixes for orange-box-sync-charmstore to improve handling and add additional error checking.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'usr/bin/orange-box-sync-charmstore'
2--- usr/bin/orange-box-sync-charmstore 2014-10-02 21:05:23 +0000
3+++ usr/bin/orange-box-sync-charmstore 2014-10-07 11:49:23 +0000
4@@ -23,26 +23,51 @@
5 set -x
6 set -e
7
8-if ! mkdir -p $BASEDIR; then
9- echo "Execute as root or with 'sudo $0'"
10- exit 1
11+if [ "$(id -u)" != "0" ]; then
12+ echo "Must be run with sudo or by root"
13+ exit 1
14 fi
15
16+bzr launchpad-login && rm -rf ~/.bazaar && bzr launchpad-login && echo "Unkown error with bzr launchpad-login" && exit 1
17+
18+mkdir -p $BASEDIR
19 cd $BASEDIR
20 echo Grabbing the latest charmstore tarball...
21 rm -f "$BASEDIR/latest.tar.gz"
22-wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz -O "$BASEDIR/latest.tar.gz"
23+wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz -O "$BASEDIR/latest.tar.gz" || exit 1
24 mkdir -p "$BASEDIR/staging"
25 echo Untarring charmstore
26 tar xzf "$BASEDIR/latest.tar.gz" -C "$BASEDIR/staging"
27 for series in precise trusty; do
28- d="$BASEDIR/$series"
29- mkdir -p "$d"
30- bzr branch lp:landscape-charm "$d/landscape"
31- bzr branch lp:charms/cinder-ceph "$d/cinder-ceph"
32- ln -s quantum-gateway "$d/neutron-gateway"
33- ln -s rabbitmq-server "$d/rabbitmq"
34+ d="$BASEDIR/staging/$series"
35+ if [ ! -e $d/landscape ];then
36+ bzr branch lp:landscape-charm "$d/landscape"
37+ fi
38+ if [ ! -e $d/cinder-ceph ]; then
39+ bzr branch lp:charms/cinder-ceph "$d/cinder-ceph"
40+ fi
41+ if [ ! -e $d/neutron-gateway ]; then
42+ ln -s quantum-gateway "$d/neutron-gateway"
43+ fi
44+ if [ ! -e $d/rabbitmq ]; then
45+ ln -s rabbitmq-server "$d/rabbitmq"
46+ fi
47+ #Check for some charms that are pre-requisites for demos to run.
48+ if [ ! -e $d/juju-gui ]; then
49+ echo "Cannot find juju-gui in charm store update, it is required, exiting."
50+ exit 1
51+ fi
52+ if [ ! -e $d/mysql ]; then
53+ echo "Cannot find mysql in charm store update, it is required, exiting."
54+ exit 1
55+ fi
56+ if [ ! -e $d/rabbitmq-server ]; then
57+ echo "Cannot find rabbitmq-server in charm store update, it is required, exiting."
58+ exit 1
59+ fi
60 done
61+
62+chown -R root.root $BASEDIR
63 echo "Removing the old directories..."
64 rm -rf "$BASEDIR/current" "$BASEDIR/snapshot-"* "$BASEDIR/precise" "$BASEDIR/trusty"
65 echo "Moving new charmstore into place"

Subscribers

People subscribed via source and target branches