~ltrager/maas-images/fix_building_bootloaders

« back to all changes in this revision

Viewing changes to meph2/commands/mimport.py

  • Committer: Lee Trager
  • Date: 2018-08-07 21:31:31 UTC
  • mto: This revision was merged to the branch mainline in revision 406.
  • Revision ID: lee.trager@canonical.com-20180807213131-raws1ae7cs9vp800
Revert Open Firmware PPC64EL bootloader to Xenial.

The Bionic bootloader for Open Firmware PPC64EL is requesting a GRUB
configuration file for the wrong MAC address(LP:1785859). Until this
bug is fixed revert to the Xenial bootloader.

To allow the bootloader to be reverted lp:maas-images will now only look to
see if the bootloader discovered in the archive differs from the latest
bootloader in the stream. Older bootloaders in the stream are ignored. This
allows the release for each bootloader to be reverted to an older version
or upgraded to a newer version without changing anything other than
bootloaders.yaml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        # the packages in the archive
113
113
        if product_id in product_tree['products']:
114
114
            versions = product_tree['products'][product_id]['versions']
115
 
            for data in versions.values():
116
 
                for item in data['items'].values():
117
 
                    src_package = src_packages.get(item['src_package'])
118
 
                    if (
119
 
                            src_package is not None and
120
 
                            src_package['src_version'] == item['src_version']
121
 
                            and
122
 
                            src_package['src_release'] == item['src_release']):
123
 
                        src_packages[item['src_package']]['found'] = True
 
115
            # Only check if the latest version in the stream matches the
 
116
            # latest version from the archive. This allows bootloaders to
 
117
            # be reverted to previous versions.
 
118
            data = versions[max(versions.keys())]
 
119
            for item in data['items'].values():
 
120
                src_package = src_packages.get(item['src_package'])
 
121
                if (
 
122
                        src_package is not None and
 
123
                        src_package['src_version'] == item['src_version'] and
 
124
                        src_package['src_release'] == item['src_release']):
 
125
                    src_packages[item['src_package']]['found'] = True
124
126
        bootloader_uptodate = True
125
127
        for src_package in src_packages.values():
126
128
            if not src_package['found']: