Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python3-azuremetadata for openSUSE:Factory checked in at 2022-01-22 08:18:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-azuremetadata (Old) and /work/SRC/openSUSE:Factory/.python3-azuremetadata.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-azuremetadata" Sat Jan 22 08:18:29 2022 rev:3 rq:947967 version:5.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python3-azuremetadata/python3-azuremetadata.changes 2020-08-29 20:43:27.133492770 +0200 +++ /work/SRC/openSUSE:Factory/.python3-azuremetadata.new.1938/python3-azuremetadata.changes 2022-01-22 08:19:23.698414198 +0100 @@ -1,0 +2,22 @@ +Thu Jan 13 21:50:24 UTC 2022 - Robert Schweikert <rjsch...@suse.com> + +- Version 5.1.5 (bsc#1194663) + + Handle lsblk output format change. The json data now contains + "mountpoints" instead of "mountpoint" + +------------------------------------------------------------------- +Wed Apr 21 17:20:35 UTC 2021 - Jes??s Berm??dez Vel??zquez <jesu...@suse.com> + +- Version 5.1.4 (bsc#1184720, bsc#1172581) + + Use versions endpoint to list the available versions + + Add bypass proxy + + Update way to check classic vms + +------------------------------------------------------------------- +Fri Aug 21 13:45:31 UTC 2020 - Robert Schweikert <rjsch...@suse.com> + +- Fix provides directive (bsc#1175609, bsc#1175610) + + The provides directive must set a version or update does not work + as expected + +------------------------------------------------------------------- Old: ---- python3-azuremetadata-5.1.2.tar.bz2 New: ---- python3-azuremetadata-5.1.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-azuremetadata.spec ++++++ --- /var/tmp/diff_new_pack.6rWzeg/_old 2022-01-22 08:19:24.086411584 +0100 +++ /var/tmp/diff_new_pack.6rWzeg/_new 2022-01-22 08:19:24.090411557 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-azuremetadata # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define upstream_name azuremetadata Name: python3-azuremetadata -Version: 5.1.2 +Version: 5.1.5 Release: 0 # Packaged renamed in SLE15 Provides: azuremetadata = %{version} @@ -32,6 +32,7 @@ Source0: %{name}-%{version}.tar.bz2 Requires: python3 Recommends: util-linux +BuildRequires: python-rpm-macros BuildRequires: python3-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++++++ python3-azuremetadata-5.1.2.tar.bz2 -> python3-azuremetadata-5.1.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-azuremetadata-5.1.2/azuremetadata new/python3-azuremetadata-5.1.5/azuremetadata --- old/python3-azuremetadata-5.1.2/azuremetadata 2020-08-03 22:43:09.990458830 +0200 +++ new/python3-azuremetadata-5.1.5/azuremetadata 2022-01-14 14:14:08.275908965 +0100 @@ -44,6 +44,9 @@ parser.print_help(string_io) help_header = string_io.getvalue() +# IMDS is not intended to be used behind a proxy and IMDS does not support it +os.environ['no_proxy'] = '169.254.169.254' + try: metadata = azuremetadata.AzureMetadata(api_args.api) data = {} @@ -52,15 +55,15 @@ # internal server error, that's the best thing we have to go on to # figure out whether or not we are in ASM. # ASM gets retired in 2023, rip this code out, it's ugly! - attested_data_url = 'http://169.254.169.254/metadata/attested/document' + instance_compute_url = 'http://169.254.169.254/metadata/instance/compute' req = urllib.request.Request( - '%s?api-version=2019-11-01' % attested_data_url, + '%s?api-version=2019-11-01' % instance_compute_url, headers={'Metadata': 'true'} ) try: response = urllib.request.urlopen(req, timeout=2) except urllib.error.HTTPError as e: - if e.getcode() == 500: + if e.getcode() == 404: # Set the api version to the first implementation, it works in ASM metadata.set_api_version('2017-04-02') # Special code for SUSE, ugh becasue we know what we are @@ -90,7 +93,7 @@ data['attestedData']['signature'] = '' data['signature'] = '' # End code removal in 2023 - + # Only root can read the tag only add the value if we are root if os.geteuid() == 0: data['billingTag'] = metadata.get_disk_tag(api_args.device) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-azuremetadata-5.1.2/lib/azuremetadata/VERSION new/python3-azuremetadata-5.1.5/lib/azuremetadata/VERSION --- old/python3-azuremetadata-5.1.2/lib/azuremetadata/VERSION 2020-08-03 22:43:09.990458830 +0200 +++ new/python3-azuremetadata-5.1.5/lib/azuremetadata/VERSION 2022-01-14 14:14:08.275908965 +0100 @@ -1 +1 @@ -5.1.2 +5.1.5 Binary files old/python3-azuremetadata-5.1.2/lib/azuremetadata/__pycache__/__init__.cpython-36.pyc and new/python3-azuremetadata-5.1.5/lib/azuremetadata/__pycache__/__init__.cpython-36.pyc differ Binary files old/python3-azuremetadata-5.1.2/lib/azuremetadata/__pycache__/azuremetadata.cpython-36.pyc and new/python3-azuremetadata-5.1.5/lib/azuremetadata/__pycache__/azuremetadata.cpython-36.pyc differ Binary files old/python3-azuremetadata-5.1.2/lib/azuremetadata/__pycache__/azuremetadatautils.cpython-36.pyc and new/python3-azuremetadata-5.1.5/lib/azuremetadata/__pycache__/azuremetadatautils.cpython-36.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-azuremetadata-5.1.2/lib/azuremetadata/azuremetadata.py new/python3-azuremetadata-5.1.5/lib/azuremetadata/azuremetadata.py --- old/python3-azuremetadata-5.1.2/lib/azuremetadata/azuremetadata.py 2020-08-03 22:43:09.990458830 +0200 +++ new/python3-azuremetadata-5.1.5/lib/azuremetadata/azuremetadata.py 2022-01-14 14:14:08.275908965 +0100 @@ -29,7 +29,7 @@ """Class for querying Azure instance metadata.""" def __init__(self, api_version=None): - self._api_version = self._get_api(api_version) if api_version else '2017-04-02' + self.set_api_version(api_version) def get_all(self): """Return all metadata. @@ -83,8 +83,9 @@ def set_api_version(self, api_version): """Set the API version to use for queries""" if not api_version: - return - self._api_version = api_version + self._api_version = '2017-04-02' + else: + self._api_version = self._get_api(api_version) @staticmethod def _find_block_device(mountpoint="/"): @@ -121,8 +122,14 @@ @staticmethod def _blockdevice_has_mountpoint(item, mountpoint): for child in item.get("children", []): - if child["mountpoint"] == mountpoint: - return True + mounts = child.get('mountpoint') + if mounts: + mounts = [mounts] + else: + mounts = child.get('mountpoints', []) + for entry in mounts: + if entry == mountpoint: + return True if AzureMetadata._blockdevice_has_mountpoint(child, mountpoint): return True @@ -143,6 +150,8 @@ data = data.decode('utf-8') return json.loads(data) except urllib.error.HTTPError as e: + # remove this case when versions API + # endpoint retrieves all the versions if no_api: err = e.read() if isinstance(err, bytes): @@ -167,14 +176,30 @@ @staticmethod def _get_api(api_version): + """Return the latest API version available if 'latest' provided or api_version.""" if api_version == 'latest': - api_newest_versions = AzureMetadata._get_api_newest_versions() + # the endpoint GET /metadata/versions + # does not return all the API versions + # excluding the version that returns license type inside attested data + # when that gets fixed, use _get_api_newest_versions() method + api_newest_versions = AzureMetadata._get_api_unlisted_versions() api_version = api_newest_versions[0] return api_version @staticmethod def _get_api_newest_versions(): - newest_api = ['2017-04-02'] + api_versions = AzureMetadata._make_request( + "http://169.254.169.254/metadata/versions" + ) + if api_versions: + return sorted(api_versions.get('apiVersions', []), reverse=True) + # if something went wrong with the query + # default to oldest version + return ['2017-03-01'] + + @staticmethod + def _get_api_unlisted_versions(): + newest_api = ['2017-03-01'] # When no API version is specified, # the response includes a list of the newest supported versions. no_api_version_result = AzureMetadata._make_request( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-azuremetadata-5.1.2/man/man1/azuremetadata.1 new/python3-azuremetadata-5.1.5/man/man1/azuremetadata.1 --- old/python3-azuremetadata-5.1.2/man/man1/azuremetadata.1 2020-08-03 22:43:09.990458830 +0200 +++ new/python3-azuremetadata-5.1.5/man/man1/azuremetadata.1 2022-01-14 14:14:08.275908965 +0100 @@ -23,7 +23,7 @@ .IP "-a --api [VERSION]" Specify metadata API version to be queried. By default the oldest available -version is used (2017-04-02). +version is used (2017-03-01). .IP "-h, --help" Print all available command line options to standard out.