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
1=== modified file 'utah/isotest/iso_static_validation.py'
2--- utah/isotest/iso_static_validation.py 2014-07-15 09:51:38 +0000
3+++ utah/isotest/iso_static_validation.py 2014-07-21 11:44:29 +0000
4@@ -57,6 +57,7 @@
5 import shutil
6 import time
7 import platform
8+import distro_info
9 from traceback import format_exception
10
11 import yaml
12@@ -163,10 +164,16 @@
13 self.st_arch])))
14 logging.debug('Standard name for this iso is: %s', self.iso_name)
15
16- if self.st_release != 'precise':
17+ try:
18+ ubuntu_distro_devel = distro_info.UbuntuDistroInfo().devel()
19+ except:
20+ self.fail("Can not find distro info details. "
21+ "Distro info data could be out of date")
22+
23+ if self.st_release != ubuntu_distro_devel:
24+ self.url = os.path.join(DEFAULT_URL, self.st_release)
25+ else:
26 self.url = DEFAULT_URL
27- else:
28- self.url = os.path.join(DEFAULT_URL, 'precise')
29
30 if self.st_variant == 'desktop':
31 self.url = os.path.join(self.url, 'daily-live')
32@@ -175,9 +182,9 @@
33 elif self.st_variant == 'alternate':
34 self.url = os.path.join(self.url, 'daily')
35 elif self.st_variant == 'server':
36- if self.st_release == 'precise':
37+ if self.st_release != ubuntu_distro_devel:
38 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server',
39- 'precise', 'daily')
40+ self.st_release, 'daily')
41 else: # current dev release
42 self.url = os.path.join(DEFAULT_URL, 'ubuntu-server', 'daily')
43 else:

Subscribers

People subscribed via source and target branches

to all changes: