Merge lp:~pawciobiel/testdrive/1297377-fix-kvm-img-not-found-report-error into lp:testdrive
- 1297377-fix-kvm-img-not-found-report-error
- Merge into trunk
Proposed by
pawciobiel
Status: | Merged |
---|---|
Merged at revision: | 451 |
Proposed branch: | lp:~pawciobiel/testdrive/1297377-fix-kvm-img-not-found-report-error |
Merge into: | lp:testdrive |
Diff against target: |
345 lines (+108/-56) 7 files modified
bin/testdrive (+14/-9) bin/testdrive-gtk (+18/-13) testdrive/virt/base.py (+16/-0) testdrive/virt/kvm.py (+24/-10) testdrive/virt/parallels.py (+12/-10) testdrive/virt/virtualbox.py (+23/-13) testdrivegtk/PreferencesTestdrivegtkDialog.py (+1/-1) |
To merge this branch: | bzr merge lp:~pawciobiel/testdrive/1297377-fix-kvm-img-not-found-report-error |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andres Rodriguez | Approve | ||
Review via email: mp+234571@code.launchpad.net |
Commit message
Description of the change
merge fix for lp:1297377
* fix virt.kvm so it checks if qemu-img or kvm-img is installed
* check if qemu-utils is installed when user selected kvm
* tide up virt a bit so testdrive-gtk can notify user about errors
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 'bin/testdrive' | |||
2 | --- bin/testdrive 2013-10-24 02:11:50 +0000 | |||
3 | +++ bin/testdrive 2014-09-13 13:13:23 +0000 | |||
4 | @@ -74,8 +74,12 @@ | |||
5 | 74 | logger.error(_("\nERROR: Invalid input\n")) | 74 | logger.error(_("\nERROR: Invalid input\n")) |
6 | 75 | continue | 75 | continue |
7 | 76 | if choice == i: | 76 | if choice == i: |
10 | 77 | url = raw_input(_("\nEnter an ISO URL to testdrive: ")) | 77 | try: |
11 | 78 | break | 78 | url = raw_input(_("\nEnter an ISO URL to testdrive: ")) |
12 | 79 | break | ||
13 | 80 | except KeyboardInterrupt: | ||
14 | 81 | print("\n") | ||
15 | 82 | exit(0) | ||
16 | 79 | elif choice in range(1, i): | 83 | elif choice in range(1, i): |
17 | 80 | url = menu[choice-1]["url"] | 84 | url = menu[choice-1]["url"] |
18 | 81 | td.ISO_PATH_HEADER = menu[choice-1]["cat"] | 85 | td.ISO_PATH_HEADER = menu[choice-1]["cat"] |
19 | @@ -85,7 +89,7 @@ | |||
20 | 85 | return(url) | 89 | return(url) |
21 | 86 | 90 | ||
22 | 87 | def error(str): | 91 | def error(str): |
24 | 88 | logger.error(_("\n%s\n") % str) | 92 | logger.error("\n%s\n" % str) |
25 | 89 | sys.exit(1) | 93 | sys.exit(1) |
26 | 90 | 94 | ||
27 | 91 | def is_iso(file): | 95 | def is_iso(file): |
28 | @@ -401,14 +405,15 @@ | |||
29 | 401 | logger.info(_("Validating Virtualization Method....")) | 405 | logger.info(_("Validating Virtualization Method....")) |
30 | 402 | try: | 406 | try: |
31 | 403 | virt.validate_virt() | 407 | virt.validate_virt() |
34 | 404 | except: | 408 | except Exception as exc: |
35 | 405 | error(_("Unable to validate Virtualization Method [%s]") % td.VIRT) | 409 | error(_("Unable to validate Virtualization Method [%s] (%s)") % \ |
36 | 410 | (td.VIRT, exc)) | ||
37 | 406 | 411 | ||
38 | 407 | logger.info(_("Setting up Virtual Machine...")) | 412 | logger.info(_("Setting up Virtual Machine...")) |
39 | 408 | try: | 413 | try: |
40 | 409 | virt.setup_virt() | 414 | virt.setup_virt() |
43 | 410 | except: | 415 | except Exception as exc: |
44 | 411 | error(_("Unable to setup Virtual Machine")) | 416 | error(_("Unable to setup Virtual Machine (%s)") % exc) |
45 | 412 | 417 | ||
46 | 413 | logger.info(_("Launching Virtual Machine...")) | 418 | logger.info(_("Launching Virtual Machine...")) |
47 | 414 | try: | 419 | try: |
48 | @@ -417,8 +422,8 @@ | |||
49 | 417 | if td.VIRT == "kvm": | 422 | if td.VIRT == "kvm": |
50 | 418 | logging.debug("%s:%s" % (time.strftime("%Y-%m-%d_%H:%M:%S"), cmd)) | 423 | logging.debug("%s:%s" % (time.strftime("%Y-%m-%d_%H:%M:%S"), cmd)) |
51 | 419 | run_vm(cmd, td, cloud_curses) | 424 | run_vm(cmd, td, cloud_curses) |
54 | 420 | except: | 425 | except Exception as exc: |
55 | 421 | error(_("Unable to launch Virtual Machine")) | 426 | error(_("Unable to launch Virtual Machine (%s)") % (exc)) |
56 | 422 | 427 | ||
57 | 423 | rm_disk = td.delete_image() | 428 | rm_disk = td.delete_image() |
58 | 424 | if rm_disk: | 429 | if rm_disk: |
59 | 425 | 430 | ||
60 | === modified file 'bin/testdrive-gtk' | |||
61 | --- bin/testdrive-gtk 2013-11-17 08:19:27 +0000 | |||
62 | +++ bin/testdrive-gtk 2014-09-13 13:13:23 +0000 | |||
63 | @@ -739,10 +739,9 @@ | |||
64 | 739 | if self.td.VIRT == "virtualbox": | 739 | if self.td.VIRT == "virtualbox": |
65 | 740 | logging.info(_("Using VirtualBox for virtual machine hosting...")) | 740 | logging.info(_("Using VirtualBox for virtual machine hosting...")) |
66 | 741 | virt = virtualbox.VBox(self.td) | 741 | virt = virtualbox.VBox(self.td) |
68 | 742 | if self.td.VIRT == "paralels": | 742 | if self.td.VIRT == "parallels": |
69 | 743 | logging.info(_("Using Parallels Desktop for virtual machine hosting...")) | 743 | logging.info(_("Using Parallels Desktop for virtual machine hosting...")) |
70 | 744 | virt = parallels.Parallels(self.td) | 744 | virt = parallels.Parallels(self.td) |
71 | 745 | |||
72 | 746 | # Passing VIRT object to ISOLIST | 745 | # Passing VIRT object to ISOLIST |
73 | 747 | ISOLIST[vm_id]["virt"] = virt | 746 | ISOLIST[vm_id]["virt"] = virt |
74 | 748 | ISOLIST[vm_id]["virt_type"] = self.td.VIRT | 747 | ISOLIST[vm_id]["virt_type"] = self.td.VIRT |
75 | @@ -924,20 +923,24 @@ | |||
76 | 924 | self.p = None | 923 | self.p = None |
77 | 925 | 924 | ||
78 | 926 | def prepare_to_launch_vm(self): | 925 | def prepare_to_launch_vm(self): |
90 | 927 | ################################################################### | 926 | """Prepare the VM to launch and return launch command""" |
91 | 928 | ######## Prepare the VM to launch and return launch command ####### | 927 | try: |
92 | 929 | ################################################################### | 928 | self.ovirt.validate_virt() |
93 | 930 | # TODO TODO TODO - Re-add validation | 929 | self.ovirt.setup_virt() |
94 | 931 | self.ovirt.validate_virt() | 930 | return self.ovirt.launch_virt() |
95 | 932 | self.ovirt.setup_virt() | 931 | except Exception as exc: |
96 | 933 | return self.ovirt.launch_virt() | 932 | text = _("Error preparing virtualization: %s") % (exc) |
86 | 934 | |||
87 | 935 | def run(self): | ||
88 | 936 | if self.virt == "virtualbox": | ||
89 | 937 | text = _(" Configuring Virtual Machine...") | ||
97 | 938 | self.status_label.set_markup("<b><i>%s</i></b>" % text) | 933 | self.status_label.set_markup("<b><i>%s</i></b>" % text) |
98 | 939 | self.status_label.show() | 934 | self.status_label.show() |
99 | 935 | logging.error("%s", exc, exc_info=1) | ||
100 | 936 | |||
101 | 937 | def run(self): | ||
102 | 938 | text = _(" Configuring Virtual Machine...") | ||
103 | 939 | self.status_label.set_markup("<b><i>%s</i></b>" % text) | ||
104 | 940 | self.status_label.show() | ||
105 | 940 | command = self.prepare_to_launch_vm() | 941 | command = self.prepare_to_launch_vm() |
106 | 942 | if not command: return | ||
107 | 943 | logger.info("Running VM command %s", command) | ||
108 | 941 | cmd = command.split() | 944 | cmd = command.split() |
109 | 942 | self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE) | 945 | self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE) |
110 | 943 | text = _(" Running Virtual Machine...") | 946 | text = _(" Running Virtual Machine...") |
111 | @@ -948,6 +951,7 @@ | |||
112 | 948 | while not self.stopthread.isSet(): | 951 | while not self.stopthread.isSet(): |
113 | 949 | if self.p.poll() != None: | 952 | if self.p.poll() != None: |
114 | 950 | self.status_label.set_markup("<i>%s</i>" % self.previous_text) | 953 | self.status_label.set_markup("<i>%s</i>" % self.previous_text) |
115 | 954 | self.status_label.show() | ||
116 | 951 | self.p = None | 955 | self.p = None |
117 | 952 | break | 956 | break |
118 | 953 | time.sleep(0.1) | 957 | time.sleep(0.1) |
119 | @@ -969,6 +973,7 @@ | |||
120 | 969 | break | 973 | break |
121 | 970 | time.sleep(2) | 974 | time.sleep(2) |
122 | 971 | 975 | ||
123 | 976 | |||
124 | 972 | def stop(self): | 977 | def stop(self): |
125 | 973 | try: | 978 | try: |
126 | 974 | if self.p.poll() is None: | 979 | if self.p.poll() is None: |
127 | 975 | 980 | ||
128 | === added file 'testdrive/virt/base.py' | |||
129 | --- testdrive/virt/base.py 1970-01-01 00:00:00 +0000 | |||
130 | +++ testdrive/virt/base.py 2014-09-13 13:13:23 +0000 | |||
131 | @@ -0,0 +1,16 @@ | |||
132 | 1 | |||
133 | 2 | import os | ||
134 | 3 | |||
135 | 4 | |||
136 | 5 | class VirtException(Exception): | ||
137 | 6 | pass | ||
138 | 7 | |||
139 | 8 | |||
140 | 9 | class VirtBase(object): | ||
141 | 10 | |||
142 | 11 | def run(self, cmd): | ||
143 | 12 | return(os.system(cmd)) | ||
144 | 13 | |||
145 | 14 | def run_or_die(self, cmd): | ||
146 | 15 | if self.run(cmd) != 0: | ||
147 | 16 | raise VirtException("Failed executing command: `%s`" % cmd) | ||
148 | 0 | 17 | ||
149 | === modified file 'testdrive/virt/kvm.py' | |||
150 | --- testdrive/virt/kvm.py 2013-05-20 17:12:31 +0000 | |||
151 | +++ testdrive/virt/kvm.py 2014-09-13 13:13:23 +0000 | |||
152 | @@ -19,10 +19,15 @@ | |||
153 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
154 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
155 | 21 | 21 | ||
156 | 22 | import sys | ||
157 | 22 | import commands, os, uuid, logging | 23 | import commands, os, uuid, logging |
158 | 23 | 24 | ||
159 | 25 | from .base import VirtException | ||
160 | 26 | |||
161 | 27 | |||
162 | 24 | logger = logging.getLogger("testdrive.virt.kvm") | 28 | logger = logging.getLogger("testdrive.virt.kvm") |
163 | 25 | 29 | ||
164 | 30 | |||
165 | 26 | class KVM: | 31 | class KVM: |
166 | 27 | 32 | ||
167 | 28 | def __init__(self, td): | 33 | def __init__(self, td): |
168 | @@ -45,19 +50,35 @@ | |||
169 | 45 | def validate_virt(self): | 50 | def validate_virt(self): |
170 | 46 | (status, output) = commands.getstatusoutput("kvm-ok") | 51 | (status, output) = commands.getstatusoutput("kvm-ok") |
171 | 47 | if status != 0: | 52 | if status != 0: |
173 | 48 | logger.info(output) | 53 | logger.warn("kvm-ok failed: %s", output) |
174 | 54 | (status, output) = commands.getstatusoutput("dpkg -l qemu-utils") | ||
175 | 55 | if status != 0: | ||
176 | 56 | raise VirtException("Package qemu-utils is not installed.") | ||
177 | 57 | |||
178 | 58 | def get_kvm_img_path(self): | ||
179 | 59 | """Get kvm-img or qemu-img path and return it. | ||
180 | 60 | |||
181 | 61 | Fall back to deprecated kvm-img. It may appear to be better | ||
182 | 62 | to call just `which qemu-img kvm-img` but this way is cleaner. | ||
183 | 63 | """ | ||
184 | 64 | for cmd in ['qemu-img', 'kvm-img']: | ||
185 | 65 | status, output = commands.getstatusoutput('which %s' % (cmd)) | ||
186 | 66 | if status == 0 and output: | ||
187 | 67 | return output.strip() | ||
188 | 68 | raise VirtException("Can not find qemu-img nor kvm-img!") | ||
189 | 49 | 69 | ||
190 | 50 | # Code to setup virtual machine | 70 | # Code to setup virtual machine |
191 | 51 | def setup_virt(self): | 71 | def setup_virt(self): |
192 | 72 | kvm_img = self.get_kvm_img_path() | ||
193 | 52 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': | 73 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': |
194 | 53 | #path = "%s/%s" % (self.CACHE_ISO, self.PATH_TO_ISO.split(".tar.gz")[0].split("_")[-1]) | 74 | #path = "%s/%s" % (self.CACHE_ISO, self.PATH_TO_ISO.split(".tar.gz")[0].split("_")[-1]) |
195 | 54 | path = "%s/%s" % (self.CACHE_ISO, os.path.basename(self.PATH_TO_ISO).split(".tar.gz")[0]) | 75 | path = "%s/%s" % (self.CACHE_ISO, os.path.basename(self.PATH_TO_ISO).split(".tar.gz")[0]) |
196 | 55 | self.ORIG_DISK = "%s.img" % path | 76 | self.ORIG_DISK = "%s.img" % path |
197 | 56 | self.FLOPPY_FILE = "%s-floppy" % path | 77 | self.FLOPPY_FILE = "%s-floppy" % path |
199 | 57 | self.run_or_die("kvm-img create -f qcow2 -b %s %s" % (self.ORIG_DISK, self.DISK_FILE)) | 78 | self.run_or_die("%s create -f qcow2 -b %s %s" % (kvm_img, self.ORIG_DISK, self.DISK_FILE)) |
200 | 58 | elif not os.path.exists(self.DISK_FILE) or self.is_disk_empty(): | 79 | elif not os.path.exists(self.DISK_FILE) or self.is_disk_empty(): |
201 | 59 | logger.info("Creating disk image [%s]..." % self.DISK_FILE) | 80 | logger.info("Creating disk image [%s]..." % self.DISK_FILE) |
203 | 60 | self.run_or_die("kvm-img create -f qcow2 %s %s" % (self.DISK_FILE, self.DISK_SIZE)) | 81 | self.run_or_die("%s create -f qcow2 %s %s" % (kvm_img, self.DISK_FILE, self.DISK_SIZE)) |
204 | 61 | 82 | ||
205 | 62 | # Code launch virtual machine | 83 | # Code launch virtual machine |
206 | 63 | def launch_virt(self): | 84 | def launch_virt(self): |
207 | @@ -68,10 +89,3 @@ | |||
208 | 68 | else: | 89 | else: |
209 | 69 | cmd = "qemu-system-x86_64 -uuid %s -m %s -smp %s -cdrom %s -drive file=%s,if=virtio,cache=writeback,index=0 %s" % (UUID, self.MEM, self.SMP, self.PATH_TO_ISO, self.DISK_FILE, self.KVM_ARGS) | 90 | cmd = "qemu-system-x86_64 -uuid %s -m %s -smp %s -cdrom %s -drive file=%s,if=virtio,cache=writeback,index=0 %s" % (UUID, self.MEM, self.SMP, self.PATH_TO_ISO, self.DISK_FILE, self.KVM_ARGS) |
210 | 70 | return cmd | 91 | return cmd |
211 | 71 | |||
212 | 72 | def run(self, cmd): | ||
213 | 73 | return(os.system(cmd)) | ||
214 | 74 | |||
215 | 75 | def run_or_die(self, cmd): | ||
216 | 76 | if self.run(cmd) != 0: | ||
217 | 77 | logger.error("Command failed\n `%s`" % cmd) | ||
218 | 78 | 92 | ||
219 | === modified file 'testdrive/virt/parallels.py' | |||
220 | --- testdrive/virt/parallels.py 2012-04-21 02:05:42 +0000 | |||
221 | +++ testdrive/virt/parallels.py 2014-09-13 13:13:23 +0000 | |||
222 | @@ -19,9 +19,16 @@ | |||
223 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
224 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
225 | 21 | 21 | ||
226 | 22 | import logging | ||
227 | 22 | import commands, os, time | 23 | import commands, os, time |
228 | 23 | 24 | ||
230 | 24 | class Parallels: | 25 | from .base import VirtBase, VirtException |
231 | 26 | |||
232 | 27 | |||
233 | 28 | logger = logging.getLogger(__name__) | ||
234 | 29 | |||
235 | 30 | |||
236 | 31 | class Parallels(VirtBase): | ||
237 | 25 | 32 | ||
238 | 26 | def __init__(self, td): | 33 | def __init__(self, td): |
239 | 27 | self.HOME = td.HOME | 34 | self.HOME = td.HOME |
240 | @@ -32,8 +39,11 @@ | |||
241 | 32 | self.DISK_SIZE = td.DISK_SIZE | 39 | self.DISK_SIZE = td.DISK_SIZE |
242 | 33 | self.VBOX_NAME = td.VBOX_NAME | 40 | self.VBOX_NAME = td.VBOX_NAME |
243 | 34 | 41 | ||
244 | 35 | # Code to validate if virtualization is installed/supported | ||
245 | 36 | def validate_virt(self): | 42 | def validate_virt(self): |
246 | 43 | """validate if virtualization is installed/supported""" | ||
247 | 44 | if commands.getstatusoutput("which prlctl")[0] != 0: | ||
248 | 45 | raise VirtException("prlctl not found") | ||
249 | 46 | |||
250 | 37 | if commands.getstatusoutput("prlctl list %s | grep -qsv \"UUID\"" % self.VBOX_NAME)[0] == 0: | 47 | if commands.getstatusoutput("prlctl list %s | grep -qsv \"UUID\"" % self.VBOX_NAME)[0] == 0: |
251 | 38 | self.run_or_die("prlctl delete %s" % self.VBOX_NAME) | 48 | self.run_or_die("prlctl delete %s" % self.VBOX_NAME) |
252 | 39 | 49 | ||
253 | @@ -55,11 +65,3 @@ | |||
254 | 55 | # Loop as long as this VM is running | 65 | # Loop as long as this VM is running |
255 | 56 | #while commands.getstatusoutput("prlctl list %s | grep -qs stopped" % self.td.VBOX_NAME)[0] != 0: | 66 | #while commands.getstatusoutput("prlctl list %s | grep -qs stopped" % self.td.VBOX_NAME)[0] != 0: |
256 | 57 | # time.sleep(2) | 67 | # time.sleep(2) |
257 | 58 | |||
258 | 59 | def run(self, cmd): | ||
259 | 60 | return(os.system(cmd)) | ||
260 | 61 | |||
261 | 62 | def run_or_die(self, cmd): | ||
262 | 63 | if self.run(cmd) != 0: | ||
263 | 64 | #error("Command failed\n `%s`" % cmd) | ||
264 | 65 | print "Command failed\n `%s`" % cmd | ||
265 | 66 | 68 | ||
266 | === modified file 'testdrive/virt/virtualbox.py' | |||
267 | --- testdrive/virt/virtualbox.py 2013-10-28 19:55:24 +0000 | |||
268 | +++ testdrive/virt/virtualbox.py 2014-09-13 13:13:23 +0000 | |||
269 | @@ -21,9 +21,13 @@ | |||
270 | 21 | 21 | ||
271 | 22 | import commands, os, time, logging | 22 | import commands, os, time, logging |
272 | 23 | 23 | ||
273 | 24 | from .base import VirtException, VirtBase | ||
274 | 25 | |||
275 | 26 | |||
276 | 24 | logger = logging.getLogger("testdrive.virt.vbox") | 27 | logger = logging.getLogger("testdrive.virt.vbox") |
277 | 25 | 28 | ||
279 | 26 | class VBox: | 29 | |
280 | 30 | class VBox(VirtBase): | ||
281 | 27 | 31 | ||
282 | 28 | def __init__(self, td): | 32 | def __init__(self, td): |
283 | 29 | self.vboxversion = None | 33 | self.vboxversion = None |
284 | @@ -42,19 +46,32 @@ | |||
285 | 42 | return True | 46 | return True |
286 | 43 | return False | 47 | return False |
287 | 44 | 48 | ||
288 | 49 | def get_vboxversion(self): | ||
289 | 50 | status, verstr = commands.getstatusoutput("VBoxManage --version") | ||
290 | 51 | if status != 0: | ||
291 | 52 | raise VirtException("No VirtualBox found") | ||
292 | 53 | try: | ||
293 | 54 | self.vboxversion = (int(verstr.split(".")[0]), | ||
294 | 55 | int(verstr.split(".")[1])) | ||
295 | 56 | except (IndexError, ValueError) as exc: | ||
296 | 57 | raise VirtException("Can not extract version " | ||
297 | 58 | "[VBoxManage --version]") | ||
298 | 59 | |||
299 | 60 | |||
300 | 45 | # Code to validate if virtualization is installed/supported | 61 | # Code to validate if virtualization is installed/supported |
301 | 46 | def validate_virt(self): | 62 | def validate_virt(self): |
302 | 47 | # Determine which version of VirtualBox we have installed. What is returned is | 63 | # Determine which version of VirtualBox we have installed. What is returned is |
303 | 48 | # typically a string such as '4.1.0r55467', lets assume that the command line | 64 | # typically a string such as '4.1.0r55467', lets assume that the command line |
304 | 49 | # is consistent within 4.x.x versions extract this part of the | 65 | # is consistent within 4.x.x versions extract this part of the |
305 | 50 | # version string for comparison later | 66 | # version string for comparison later |
309 | 51 | self.vboxversion = commands.getoutput("VBoxManage --version") | 67 | self.vboxversion = self.get_vboxversion() |
310 | 52 | self.vboxversion = ( int(self.vboxversion.split(".")[0]), int(self.vboxversion.split(".")[1]) ) | 68 | supported_versions = ((4,0), (4,1), (4,2), (4,3)) |
311 | 53 | if self.vboxversion == (4,0) or self.vboxversion == (4,1) or self.vboxversion == (4,2) or self.vboxversion == (4,3): | 69 | if self.vboxversion in supported_versions: |
312 | 54 | logger.info("VirtualBox %s.%s detected." % self.vboxversion) | 70 | logger.info("VirtualBox %s.%s detected." % self.vboxversion) |
313 | 55 | else: | 71 | else: |
316 | 56 | logger.error("ERROR: Unsupported version (%s.%s) of VirtualBox; please install v4.0 or newer." % self.vboxversion) | 72 | err_text = ("Unsupported version (%s.%s) of VirtualBox; " |
317 | 57 | exit(0) | 73 | "please install v4.0 or newer.") % self.vboxversion |
318 | 74 | raise VirtException(err_text) | ||
319 | 58 | 75 | ||
320 | 59 | # Code to setup virtual machine | 76 | # Code to setup virtual machine |
321 | 60 | def setup_virt(self): | 77 | def setup_virt(self): |
322 | @@ -104,10 +121,3 @@ | |||
323 | 104 | # Loop as long as this VM is running | 121 | # Loop as long as this VM is running |
324 | 105 | #while commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % self.td.VBOX_NAME)[0] == 0: | 122 | #while commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % self.td.VBOX_NAME)[0] == 0: |
325 | 106 | # time.sleep(2) | 123 | # time.sleep(2) |
326 | 107 | |||
327 | 108 | def run(self, cmd): | ||
328 | 109 | return(os.system(cmd)) | ||
329 | 110 | |||
330 | 111 | def run_or_die(self, cmd): | ||
331 | 112 | if self.run(cmd) != 0: | ||
332 | 113 | logger.error("Command failed\n `%s`" % cmd) | ||
333 | 114 | 124 | ||
334 | === modified file 'testdrivegtk/PreferencesTestdrivegtkDialog.py' | |||
335 | --- testdrivegtk/PreferencesTestdrivegtkDialog.py 2013-10-24 14:10:11 +0000 | |||
336 | +++ testdrivegtk/PreferencesTestdrivegtkDialog.py 2014-09-13 13:13:23 +0000 | |||
337 | @@ -481,7 +481,7 @@ | |||
338 | 481 | path = "%s/%s" % (cache_path, file) | 481 | path = "%s/%s" % (cache_path, file) |
339 | 482 | os.unlink(path) | 482 | os.unlink(path) |
340 | 483 | except: | 483 | except: |
342 | 484 | on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) | 484 | self.on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) |
343 | 485 | 485 | ||
344 | 486 | def on_select_iso_image_repo(self, widget): | 486 | def on_select_iso_image_repo(self, widget): |
345 | 487 | ################################################################## | 487 | ################################################################## |
lgtm!