utah: urlchecker does not check the validity of the preseed location
Bug #1025220 reported by
Para Siva
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UTAH |
Fix Released
|
Low
|
Javier Collado |
Bug Description
At the moment the url validity checker does not check if the location specified for preseed file is a valid location and that the file exists in where it is said it is.
Since the checker is already doing this check for image files and the run lists, it will be better that it does the same for preseed files.
Related branches
lp:~javier.collado/utah/bug1025220
- Max Brustkern (community): Approve
-
Diff: 137 lines (+38/-36)3 files modifiedexamples/run_utah_tests.py (+7/-28)
utah/provisioning/provisioning.py (+15/-8)
utah/url.py (+16/-0)
tags: | added: qa-manual-testing quantal |
Changed in utah: | |
status: | New → Confirmed |
importance: | Undecided → Low |
assignee: | nobody → Javier Collado (javier.collado) |
Changed in utah: | |
status: | Confirmed → In Progress |
Changed in utah: | |
status: | In Progress → Fix Committed |
Changed in utah: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
If we're doing this for preseed files, we might as well do kernel files, initrd files, and vm xml files. There's a block in utah/provisioni ng/provisioning .py like this:
for item in ['preseed', 'xml', 'kernel', 'initrd', 'image']:
self. __dict_ _[item] = None
path = os.path. expanduser( locals( )[item] )
self. logger. debug(' Rewriting ~-based path: ' + locals()[item] + ' to: ' + path)
else:
path = locals()[item]
self. percent = 0
self. logger. info('Preparing ' + item + ': ' + path)
self. __dict_ _[item] = urllib. urlretrieve( path, reporthook= self.dldisplay) [0]
self. logger. debug(path + ' is locally available as ' + self.__ dict__[ item])
if locals()[item] is None:
else:
if '~' in locals()[item]:
I think maybe that block, in the base Machine class, would be a good place to insert checking for all of those, since one change there will cover all of those file types. We'd probably want to raise an exception that gets caught by the script provisioning the machine.