virtualization script chokes on emtpy 'timeout' line in config file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
High
|
Jeff Lane |
Bug Description
Two related issues. In theory, if I have a config filed in /etc/checkbox.d the virtualization test should read that, get the path to the local copy of my cloud image, and use that for testing without needing to download anything. IN reality, what happens is that even with the config file present, the test STILL tries downloading cloud images from the internet. When there's no network access, this causes a traceback (actually a series of nested tracebacks :( )
Here's my current config file:
bladernr@
[KVM]
image:/
timeout:
WITH network access (internet), the script immediately starts downloading an image from cloud-images.
REGARDLESS of network access, if I use the --image option explicity, it does the right thing and tries to use my local image.
WITHOUT network access, the script ignores my config file at the start (it probably would try reading later), immediately tries downloading an image and the lack of internet access results in a traceback:
bladernr@
Executing KVM Test
WARNING:
DEBUG:root:
Traceback (most recent call last):
File "/usr/lib/
h.request(
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.send(msg)
File "/usr/lib/
self.connect()
File "/usr/lib/
self.timeout, self.source_
File "/usr/lib/
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./virtualization", line 275, in <module>
main()
File "./virtualization", line 272, in main
args.func(args)
File "./virtualization", line 241, in test_kvm
result = kvm_test.start()
File "./virtualization", line 180, in start
self.image = self.download_
File "./virtualization", line 75, in download_image
resp = urllib.
File "/usr/lib/
with contextlib.
File "/usr/lib/
return opener.open(url, data, timeout)
File "/usr/lib/
response = self._open(req, data)
File "/usr/lib/
'_open', req)
File "/usr/lib/
result = func(*args)
File "/usr/lib/
return self.do_
File "/usr/lib/
raise URLError(err)
urllib.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/
binary = os.path.
FileNotFoundError: [Errno 2] No such file or directory
Original exception was:
Traceback (most recent call last):
File "/usr/lib/
h.request(
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.send(msg)
File "/usr/lib/
self.connect()
File "/usr/lib/
self.timeout, self.source_
File "/usr/lib/
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./virtualization", line 275, in <module>
main()
File "./virtualization", line 272, in main
args.func(args)
File "./virtualization", line 241, in test_kvm
result = kvm_test.start()
File "./virtualization", line 180, in start
self.image = self.download_
File "./virtualization", line 75, in download_image
resp = urllib.
File "/usr/lib/
with contextlib.
File "/usr/lib/
return opener.open(url, data, timeout)
File "/usr/lib/
response = self._open(req, data)
File "/usr/lib/
'_open', req)
File "/usr/lib/
result = func(*args)
File "/usr/lib/
return self.do_
File "/usr/lib/
raise URLError(err)
urllib.
Related branches
- Daniel Manrique (community): Approve
-
Diff: 89 lines (+31/-12)2 files modifieddebian/changelog (+4/-1)
scripts/virtualization (+27/-11)
summary: |
- virtualization script does not honor config file and tracebacks when no - network is presentlk + virtualization script chokes on emtpy 'timeout' line in config file |
Changed in checkbox: | |
status: | In Progress → Fix Committed |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
First issue... that may be the only issue... if timeout: is empty in the config file, the parsing of that file creates an exception because of the explicit attempt to cast an empty string to an int.