Merge lp:~mvo/ubuntu-qa-tools/mvo into lp:ubuntu-qa-tools

Proposed by Michael Vogt
Status: Merged
Merge reported by: Jamie Strandboge
Merged at revision: not available
Proposed branch: lp:~mvo/ubuntu-qa-tools/mvo
Merge into: lp:ubuntu-qa-tools
Diff against target: 264 lines (+82/-1)
16 files modified
vm-tools/vm-clone (+5/-0)
vm-tools/vm-cmd (+5/-0)
vm-tools/vm-emulator (+5/-0)
vm-tools/vm-iso (+5/-0)
vm-tools/vm-list (+5/-0)
vm-tools/vm-modify (+5/-0)
vm-tools/vm-new (+7/-1)
vm-tools/vm-new-vmbuilder (+5/-0)
vm-tools/vm-qrt (+5/-0)
vm-tools/vm-remove (+5/-0)
vm-tools/vm-repo (+5/-0)
vm-tools/vm-start (+5/-0)
vm-tools/vm-stop (+5/-0)
vm-tools/vm-update (+5/-0)
vm-tools/vm-use-snapshots (+5/-0)
vm-tools/vm-view (+5/-0)
To merge this branch: bzr merge lp:~mvo/ubuntu-qa-tools/mvo
Reviewer Review Type Date Requested Status
Jamie Strandboge Approve
Review via email: mp+88474@code.launchpad.net

Description of the change

This branch contains some small tweaks. It will set the UQT_VM_TOOLS automatically for all scripts if its not set already (thanks to Marc Deslauriers for the initial version of this).

It will also error if virt-install is not installed and suggest installing it.

And it will only abort if a existing directory for a new VM is non-empty.

To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'vm-tools/vm-clone'
2--- vm-tools/vm-clone 2011-05-18 12:31:17 +0000
3+++ vm-tools/vm-clone 2012-01-13 10:13:00 +0000
4@@ -17,6 +17,11 @@
5 exit 1
6 fi
7
8+# Find out our current directory
9+if [ -z "$UQT_VM_TOOLS" ]; then
10+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
11+fi
12+
13 . $UQT_VM_TOOLS/libvm.sh
14 abort_if_root
15
16
17=== modified file 'vm-tools/vm-cmd'
18--- vm-tools/vm-cmd 2011-07-12 00:33:51 +0000
19+++ vm-tools/vm-cmd 2012-01-13 10:13:00 +0000
20@@ -14,6 +14,11 @@
21 exit 1
22 fi
23
24+# Find out our current directory
25+if [ -z "$UQT_VM_TOOLS" ]; then
26+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
27+fi
28+
29 . $UQT_VM_TOOLS/libvm.sh
30 abort_if_root
31
32
33=== modified file 'vm-tools/vm-emulator'
34--- vm-tools/vm-emulator 2009-03-30 20:57:59 +0000
35+++ vm-tools/vm-emulator 2012-01-13 10:13:00 +0000
36@@ -14,6 +14,11 @@
37 exit 1
38 fi
39
40+# Find out our current directory
41+if [ -z "$UQT_VM_TOOLS" ]; then
42+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
43+fi
44+
45 emul="$1"
46 bemul=`basename $emul`
47 shift || true
48
49=== modified file 'vm-tools/vm-iso'
50--- vm-tools/vm-iso 2011-04-26 16:07:29 +0000
51+++ vm-tools/vm-iso 2012-01-13 10:13:00 +0000
52@@ -14,6 +14,11 @@
53 exit 1
54 fi
55
56+# Find out our current directory
57+if [ -z "$UQT_VM_TOOLS" ]; then
58+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
59+fi
60+
61 . $UQT_VM_TOOLS/libvm.sh
62 abort_if_root
63
64
65=== modified file 'vm-tools/vm-list'
66--- vm-tools/vm-list 2011-05-23 19:14:36 +0000
67+++ vm-tools/vm-list 2012-01-13 10:13:00 +0000
68@@ -15,6 +15,11 @@
69 exit 1
70 fi
71
72+# Find out our current directory
73+if [ -z "$UQT_VM_TOOLS" ]; then
74+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
75+fi
76+
77 . $UQT_VM_TOOLS/libvm.sh
78 abort_if_root
79
80
81=== modified file 'vm-tools/vm-modify'
82--- vm-tools/vm-modify 2009-03-30 20:57:59 +0000
83+++ vm-tools/vm-modify 2012-01-13 10:13:00 +0000
84@@ -15,6 +15,11 @@
85 exit 1
86 fi
87
88+# Find out our current directory
89+if [ -z "$UQT_VM_TOOLS" ]; then
90+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
91+fi
92+
93 . $UQT_VM_TOOLS/libvm.sh
94 abort_if_root
95
96
97=== modified file 'vm-tools/vm-new'
98--- vm-tools/vm-new 2012-01-11 17:11:03 +0000
99+++ vm-tools/vm-new 2012-01-13 10:13:00 +0000
100@@ -114,6 +114,12 @@
101 . $UQT_VM_TOOLS/libvm.sh
102 abort_if_root
103
104+which virt-install > /dev/null || {
105+ echo "Could not find virt-install. It is needed to create the machine."
106+ echo "Perhaps try: apt-get install virtinst"
107+ exit 1
108+}
109+
110 which xorriso >/dev/null || {
111 echo "Could not find xorriso. It is needed to extract iso files. Aborting"
112 echo "Perhaps try: apt-get install xorriso"
113@@ -853,7 +859,7 @@
114 continue
115 fi
116
117- if [ -e "${vm_path}/${vmname}" ]; then
118+ if [ -e "${vm_path}/${vmname}" ] && [ -n "$(ls ${vm_path}/${vmname})" ]; then
119 echo "'${vm_path}/${vmname}' already exists. Skipping" >&2
120 continue
121 fi
122
123=== modified file 'vm-tools/vm-new-vmbuilder'
124--- vm-tools/vm-new-vmbuilder 2011-06-10 17:04:30 +0000
125+++ vm-tools/vm-new-vmbuilder 2012-01-13 10:13:00 +0000
126@@ -19,6 +19,11 @@
127 exit 1
128 fi
129
130+# Find out our current directory
131+if [ -z "$UQT_VM_TOOLS" ]; then
132+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
133+fi
134+
135 . $UQT_VM_TOOLS/libvm.sh
136 abort_if_root
137
138
139=== modified file 'vm-tools/vm-qrt'
140--- vm-tools/vm-qrt 2011-05-23 21:24:21 +0000
141+++ vm-tools/vm-qrt 2012-01-13 10:13:00 +0000
142@@ -14,6 +14,11 @@
143 exit 1
144 fi
145
146+# Find out our current directory
147+if [ -z "$UQT_VM_TOOLS" ]; then
148+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
149+fi
150+
151 . $UQT_VM_TOOLS/libvm.sh
152 abort_if_root
153
154
155=== modified file 'vm-tools/vm-remove'
156--- vm-tools/vm-remove 2011-05-23 19:52:14 +0000
157+++ vm-tools/vm-remove 2012-01-13 10:13:00 +0000
158@@ -14,6 +14,11 @@
159 exit 1
160 fi
161
162+# Find out our current directory
163+if [ -z "$UQT_VM_TOOLS" ]; then
164+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
165+fi
166+
167 . $UQT_VM_TOOLS/libvm.sh
168 abort_if_root
169
170
171=== modified file 'vm-tools/vm-repo'
172--- vm-tools/vm-repo 2011-06-01 22:37:14 +0000
173+++ vm-tools/vm-repo 2012-01-13 10:13:00 +0000
174@@ -14,6 +14,11 @@
175 exit 1
176 fi
177
178+# Find out our current directory
179+if [ -z "$UQT_VM_TOOLS" ]; then
180+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
181+fi
182+
183 . $UQT_VM_TOOLS/libvm.sh
184 abort_if_root
185
186
187=== modified file 'vm-tools/vm-start'
188--- vm-tools/vm-start 2011-06-01 22:37:14 +0000
189+++ vm-tools/vm-start 2012-01-13 10:13:00 +0000
190@@ -15,6 +15,11 @@
191 exit 1
192 fi
193
194+# Find out our current directory
195+if [ -z "$UQT_VM_TOOLS" ]; then
196+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
197+fi
198+
199 . $UQT_VM_TOOLS/libvm.sh
200 abort_if_root
201
202
203=== modified file 'vm-tools/vm-stop'
204--- vm-tools/vm-stop 2011-06-01 22:37:14 +0000
205+++ vm-tools/vm-stop 2012-01-13 10:13:00 +0000
206@@ -16,6 +16,11 @@
207 exit 1
208 fi
209
210+# Find out our current directory
211+if [ -z "$UQT_VM_TOOLS" ]; then
212+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
213+fi
214+
215 . $UQT_VM_TOOLS/libvm.sh
216 abort_if_root
217
218
219=== modified file 'vm-tools/vm-update'
220--- vm-tools/vm-update 2011-06-01 22:37:14 +0000
221+++ vm-tools/vm-update 2012-01-13 10:13:00 +0000
222@@ -21,6 +21,11 @@
223 exit 1
224 fi
225
226+# Find out our current directory
227+if [ -z "$UQT_VM_TOOLS" ]; then
228+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
229+fi
230+
231 . $UQT_VM_TOOLS/libvm.sh
232 abort_if_root
233
234
235=== modified file 'vm-tools/vm-use-snapshots'
236--- vm-tools/vm-use-snapshots 2011-07-06 15:11:42 +0000
237+++ vm-tools/vm-use-snapshots 2012-01-13 10:13:00 +0000
238@@ -15,6 +15,11 @@
239 exit 1
240 fi
241
242+# Find out our current directory
243+if [ -z "$UQT_VM_TOOLS" ]; then
244+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
245+fi
246+
247 . $UQT_VM_TOOLS/libvm.sh
248 abort_if_root
249
250
251=== modified file 'vm-tools/vm-view'
252--- vm-tools/vm-view 2011-06-01 22:37:14 +0000
253+++ vm-tools/vm-view 2012-01-13 10:13:00 +0000
254@@ -17,6 +17,11 @@
255 exit 1
256 fi
257
258+# Find out our current directory
259+if [ -z "$UQT_VM_TOOLS" ]; then
260+ UQT_VM_TOOLS=$(dirname $(readlink -f $0))
261+fi
262+
263 . $UQT_VM_TOOLS/libvm.sh
264 abort_if_root
265