Merge lp:~psivaa/utah/bug-1343881 into lp:utah

Proposed by Para Siva
Status: Merged
Merged at revision: 1056
Proposed branch: lp:~psivaa/utah/bug-1343881
Merge into: lp:utah
Diff against target: 43 lines (+12/-5)
1 file modified
utah/isotest/iso_static_validation.py (+12/-5)
To merge this branch: bzr merge lp:~psivaa/utah/bug-1343881
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Needs Fixing
Paul Larson Approve
Review via email: mp+227294@code.launchpad.net

Commit message

Description of the change

Fix for bug https://bugs.launchpad.net/utah/+bug/1343881. Skip inserting the release name in the cdimage url only for devel release.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Convert to use distro_info instead please (see: python-distro-info, I think it's used elsewhere in utah probably). This would be more pythonic, and probably a bit more concise as well.

review: Needs Fixing
lp:~psivaa/utah/bug-1343881 updated
1053. By Para Siva

Fixes with python-distro-info

Revision history for this message
Paul Larson (pwlars) wrote :

looks ok to me

review: Approve
lp:~psivaa/utah/bug-1343881 updated
1054. By Para Siva

Include UbuntuDistroInfo inside try catch

1055. By Para Siva

log the errors during distro info finding

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

In the following code:

17 + try:
18 + ubuntu_distro = distro_info.UbuntuDistroInfo()
19 + except Exception as e:
20 + logging.error("Can not find distro info %s", e.message)
21 +
22 + if self.st_release != ubuntu_distro.devel():
23 + self.url = os.path.join(DEFAULT_URL, self.st_release)
24 + else:

If distro info data is obsolete, ubuntu_distro will be undefined and the rest of the code will fail. I'd rather do:
try:
    ubuntu_distro_devel = distro_info.UbuntuDistroInfo().devel()
except:
    logging.error(...)
    exit

A fallback to a default distro might also be an option but it'll require to update the code every new release.

review: Needs Fixing
lp:~psivaa/utah/bug-1343881 updated
1056. By Para Siva

Review comment fix- phase 2

Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the comments again jibel. Fixed it. Could you pls take a look at rev 1056?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'utah/isotest/iso_static_validation.py'
--- utah/isotest/iso_static_validation.py 2014-07-15 09:51:38 +0000
+++ utah/isotest/iso_static_validation.py 2014-07-21 11:44:29 +0000
@@ -57,6 +57,7 @@
57import shutil57import shutil
58import time58import time
59import platform59import platform
60import distro_info
60from traceback import format_exception61from traceback import format_exception
6162
62import yaml63import yaml
@@ -163,10 +164,16 @@
163 self.st_arch])))164 self.st_arch])))
164 logging.debug('Standard name for this iso is: %s', self.iso_name)165 logging.debug('Standard name for this iso is: %s', self.iso_name)
165166
166 if self.st_release != 'precise':167 try:
168 ubuntu_distro_devel = distro_info.UbuntuDistroInfo().devel()
169 except:
170 self.fail("Can not find distro info details. "
171 "Distro info data could be out of date")
172
173 if self.st_release != ubuntu_distro_devel:
174 self.url = os.path.join(DEFAULT_URL, self.st_release)
175 else:
167 self.url = DEFAULT_URL176 self.url = DEFAULT_URL
168 else:
169 self.url = os.path.join(DEFAULT_URL, 'precise')
170177
171 if self.st_variant == 'desktop':178 if self.st_variant == 'desktop':
172 self.url = os.path.join(self.url, 'daily-live')179 self.url = os.path.join(self.url, 'daily-live')
@@ -175,9 +182,9 @@
175 elif self.st_variant == 'alternate':182 elif self.st_variant == 'alternate':
176 self.url = os.path.join(self.url, 'daily')183 self.url = os.path.join(self.url, 'daily')
177 elif self.st_variant == 'server':184 elif self.st_variant == 'server':
178 if self.st_release == 'precise':185 if self.st_release != ubuntu_distro_devel:
179 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server',186 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server',
180 'precise', 'daily')187 self.st_release, 'daily')
181 else: # current dev release188 else: # current dev release
182 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server', 'daily')189 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server', 'daily')
183 else:190 else:

Subscribers

People subscribed via source and target branches

to all changes: