~barry/ubuntu-system-image/lp1444347

« back to all changes in this revision

Viewing changes to lib/systemimage/generators.py

  • Committer: Stéphane Graber
  • Date: 2014-11-18 23:17:16 UTC
  • mfrom: (252.1.5 server-azure-device)
  • Revision ID: stgraber@ubuntu.com-20141118231716-6ifayp7zziycvdx2
Add support for azure_amd64

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
    arch = "armhf"
369
369
    if environment['device_name'] in ("generic_x86", "generic_i386"):
370
370
        arch = "i386"
371
 
    elif environment['device_name'] in ("generic_amd64",):
 
371
    elif environment['device_name'] in ("generic_amd64", "azure_amd64"):
372
372
        arch = "amd64"
373
373
 
374
374
    # Check that the directory exists
703
703
        arch = "i386"
704
704
    elif environment['device_name'] in ("generic_amd64",):
705
705
        arch = "amd64"
 
706
    elif environment['device_name'] == "azure_amd64":
 
707
        arch = "amd64.azure"
706
708
 
707
709
    # Check that the directory exists
708
710
    if not os.path.exists(cdimage_path):
715
717
            continue
716
718
 
717
719
        # Check for the custom tarball
718
 
        raw_device_path = os.path.join(cdimage_path, version,
719
 
                                       "%s-preinstalled-%s-%s.device.tar.gz" %
720
 
                                       (series, options.get("product", "core"),
721
 
                                        arch))
 
720
        raw_device_path = os.path.join(
 
721
            cdimage_path, version,
 
722
            "%s-preinstalled-%s-%s.device.tar.gz" %
 
723
            (series, options.get("product", "core"),
 
724
             arch))
722
725
        if not os.path.exists(raw_device_path):
723
726
            continue
724
727
 
783
786
        metadata['series'] = series
784
787
        metadata['raw_device_path'] = raw_device_path
785
788
        metadata['raw_device_checksum'] = raw_device_hash
 
789
        metadata['device'] = environment.get('device_name', 'none')
786
790
 
787
791
        with open(path.replace(".tar.xz", ".json"), "w+") as fd:
788
792
            fd.write("%s\n" % json.dumps(metadata, sort_keys=True,