Paul Larson has proposed merging 
lp:~pwlars/ubuntu-server-iso-testing/download-specified-build into 
lp:ubuntu-server-iso-testing.

Requested reviews:
  Ubuntu Server Iso Testing Developers (ubuntu-server-iso-testing-dev)

For more details, see:
https://code.launchpad.net/~pwlars/ubuntu-server-iso-testing/download-specified-build/+merge/154963

Now that we have pending builds on cdimage, "latest" is now ambiguous
and could mean to download current, or could mean to download pending.
This just makes it so that the user can specify.  As a side-effect, any
build could be specified but I don't see that as a problem.  The default
is still to download current.
-- 
https://code.launchpad.net/~pwlars/ubuntu-server-iso-testing/download-specified-build/+merge/154963
Your team Ubuntu Server Iso Testing Developers is requested to review the 
proposed merge of lp:~pwlars/ubuntu-server-iso-testing/download-specified-build 
into lp:ubuntu-server-iso-testing.
=== modified file 'download-latest-test-iso.py'
--- download-latest-test-iso.py	2012-12-06 20:20:59 +0000
+++ download-latest-test-iso.py	2013-03-22 14:15:26 +0000
@@ -71,12 +71,12 @@
     logging.debug("Local File Checksum: '%s'", l_sha256)
     return sha256_hash == l_sha256
 
-def download_iso(isoroot, release, variant, arch, flavor=None, no_act=False):
+def download_iso(isoroot, release, variant, arch, build, flavor=None, no_act=False):
     """ Download an iso """
     logging.info("Downloading ISO...")
     cmd = ['dl-ubuntu-test-iso', '--variant=%s' % variant,
                     '--arch=%s' % arch, '--release=%s' % release,
-                    '--build=current' ,'--isoroot=%s' % isoroot, '-P']
+                    '--build=%s' % build ,'--isoroot=%s' % isoroot, '-P']
 
     if flavor:
         cmd.append('--flavor=%s' % flavor)
@@ -136,6 +136,9 @@
     parser.add_option('-u', '--url', dest="base_url", default=BASE_URL,
                       help="Base URL for cdimage retrieval website (default=%s)"
                       % BASE_URL)
+    parser.add_option('-b', '--build', dest="build", default="current",
+                      help="build directory to download from, default is "
+                      "'current'")
 
     (options, args) = parser.parse_args()
 
@@ -169,7 +172,7 @@
 
     # Download and store sha256 digest for required ISO images
     l_current_iso_digest = {}
-    sha256sum_url = os.path.join(l_url, 'current', 'SHA256SUMS')
+    sha256sum_url = os.path.join(l_url, options.build, 'SHA256SUMS')
     try:
         fh = urllib2.urlopen(sha256sum_url)
     except urllib2.HTTPError, e:
@@ -186,7 +189,7 @@
     # Check to see if version on disk is already the latest
     for arch in l_archs:
         l_iso_name = '-'.join((options.release, options.variant, arch)) + '.iso'
-        l_iso_url = os.path.join(l_url, 'current', l_iso_name)
+        l_iso_url = os.path.join(l_url, options.build, l_iso_name)
 
         # Check ISO availability on remote server
         for retry in range(1, RETRY_MAX+1):
@@ -219,8 +222,8 @@
                 if not validate_sha256(l_iso_location, iso_sha256):
                     logging.debug("ISO '%s' is not the latest", l_iso_name)
                     rc = download_iso(options.isoroot, options.release,
-                                      options.variant, arch, options.flavor,
-                                      options.no_act)
+                                      options.variant, arch, options.build,
+                                      options.flavor, options.no_act)
                 else:
                     logging.info("Required ISO version '%s' already in cache",
                                  l_iso_name)
@@ -228,8 +231,8 @@
                 # ISO does not exist need to download
                 logging.info("Downloading ISO '%s' to local cache", l_iso_name)
                 rc = download_iso(options.isoroot, options.release,
-                                  options.variant, arch, options.flavor,
-                                  options.no_act)
+                                  options.variant, arch, options.build,
+                                  options.flavor, options.no_act)
 
             if rc != 0:
                 logging.error("Failed to download ISO. Aborting!")

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-server-iso-testing-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-server-iso-testing-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to