mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-28 02:41:35 +00:00
Use a list of url formats for downloading the appropriate touch image manifest for a given release.
This commit is contained in:
parent
d412b71391
commit
7e38fec3cb
41
boottest.py
41
boottest.py
@ -69,22 +69,33 @@ class TouchManifest(object):
|
|||||||
self._manifest = self._load()
|
self._manifest = self._load()
|
||||||
|
|
||||||
def __fetch_manifest(self, project, series):
|
def __fetch_manifest(self, project, series):
|
||||||
url = "http://cdimage.ubuntu.com/{}/daily-preinstalled/" \
|
# There are two url formats that may lead to the proper manifest
|
||||||
"pending/{}-preinstalled-touch-armhf.manifest".format(
|
# file. The first form is for series that have been released,
|
||||||
project, series
|
# the second form is for the current development series.
|
||||||
)
|
# Only one of these is expected to exist for any given series.
|
||||||
|
url_list = [
|
||||||
|
"http://cdimage.ubuntu.com/{}/{}/daily-preinstalled/pending/" \
|
||||||
|
"{}-preinstalled-touch-armhf.manifest".format(
|
||||||
|
project, series, series),
|
||||||
|
"http://cdimage.ubuntu.com/{}/daily-preinstalled/pending/" \
|
||||||
|
"{}-preinstalled-touch-armhf.manifest".format(
|
||||||
|
project, series),
|
||||||
|
]
|
||||||
|
|
||||||
success = False
|
success = False
|
||||||
if self.verbose:
|
for url in url_list:
|
||||||
print(
|
if self.verbose:
|
||||||
"I: [%s] - Fetching manifest from %s" % (
|
print("I: [%s] - Fetching manifest from %s" %
|
||||||
time.asctime(), url))
|
(time.asctime(), url))
|
||||||
print("I: [%s] - saving it to %s" % (time.asctime(), self.path))
|
print("I: [%s] - saving it to %s" %
|
||||||
try:
|
(time.asctime(), self.path))
|
||||||
response = urllib.urlopen(url)
|
try:
|
||||||
except IOError as e:
|
response = urllib.urlopen(url)
|
||||||
print("W: [%s] - error connecting to %s: %s" % (
|
if response.code == 200:
|
||||||
time.asctime(), self.path, e))
|
break
|
||||||
return success # failure
|
except IOError as e:
|
||||||
|
print("W: [%s] - error connecting to %s: %s" % (
|
||||||
|
time.asctime(), self.path, e))
|
||||||
|
|
||||||
# Only [re]create the manifest file if one was successfully downloaded
|
# Only [re]create the manifest file if one was successfully downloaded
|
||||||
# this allows for an existing image to be used if the download fails.
|
# this allows for an existing image to be used if the download fails.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user