Hello community, here is the log from the commit of package python-glean for openSUSE:Factory checked in at 2020-06-05 20:19:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-glean (Old) and /work/SRC/openSUSE:Factory/.python-glean.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-glean" Fri Jun 5 20:19:50 2020 rev:7 rq:811558 version:1.18.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-glean/python-glean.changes 2020-05-28 09:16:57.120911721 +0200 +++ /work/SRC/openSUSE:Factory/.python-glean.new.3606/python-glean.changes 2020-06-05 20:25:48.372867617 +0200 @@ -1,0 +2,13 @@ +Thu Jun 4 16:13:19 UTC 2020 - Dirk Mueller <dmuel...@suse.com> + +- update to 1.18.0: + * write one resolv config + * Switch to Fedora 30 jobs + * Fix a handful of bugs in config-drive processing + * Remove trusty job + * Move opensuse jobs to experimental for now + * Add support for SLES + * Do not bring up udev assigned interfaces + * Update testing to opensuse 15 + +------------------------------------------------------------------- Old: ---- glean-1.15.0.tar.gz New: ---- glean-1.18.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-glean.spec ++++++ --- /var/tmp/diff_new_pack.QaYIbx/_old 2020-06-05 20:25:51.856879268 +0200 +++ /var/tmp/diff_new_pack.QaYIbx/_new 2020-06-05 20:25:51.860879282 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-glean -Version: 1.15.0 +Version: 1.18.0 Release: 0 Summary: Program to write static config from config-drive License: Apache-2.0 @@ -35,7 +35,6 @@ # SECTION test requirements BuildRequires: %{python_module Sphinx >= 1.1.2} BuildRequires: %{python_module mock >= 1.0} -BuildRequires: %{python_module oslosphinx} BuildRequires: %{python_module oslotest >= 1.1.0.0a1} BuildRequires: %{python_module python-subunit} BuildRequires: %{python_module testrepository >= 0.0.18} ++++++ glean-1.15.0.tar.gz -> glean-1.18.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/.zuul.yaml new/glean-1.18.0/.zuul.yaml --- old/glean-1.15.0/.zuul.yaml 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/.zuul.yaml 2020-04-21 22:17:14.000000000 +0200 @@ -7,24 +7,20 @@ - dib-nodepool-functional-openstack-gentoo-src: voting: false - dib-nodepool-functional-openstack-centos-7-src - - dib-nodepool-functional-openstack-fedora-29-src - - dib-nodepool-functional-openstack-ubuntu-trusty-src + - dib-nodepool-functional-openstack-fedora-30-src - dib-nodepool-functional-openstack-ubuntu-xenial-src - dib-nodepool-functional-openstack-ubuntu-bionic - dib-nodepool-functional-openstack-ubuntu-bionic-src - - dib-nodepool-functional-openstack-opensuse-150-src - - dib-nodepool-functional-openstack-opensuse-tumbleweed-src gate: jobs: - dib-nodepool-functional-openstack-centos-7-src - - dib-nodepool-functional-openstack-fedora-29-src - - dib-nodepool-functional-openstack-ubuntu-trusty-src + - dib-nodepool-functional-openstack-fedora-30-src - dib-nodepool-functional-openstack-ubuntu-xenial-src - dib-nodepool-functional-openstack-ubuntu-bionic - dib-nodepool-functional-openstack-ubuntu-bionic-src - - dib-nodepool-functional-openstack-opensuse-150-src - - dib-nodepool-functional-openstack-opensuse-tumbleweed-src experimental: jobs: - dib-nodepool-functional-openstack-debian-stretch-src - dib-nodepool-functional-openstack-debian-buster-src + - dib-nodepool-functional-openstack-opensuse-15-src + - dib-nodepool-functional-openstack-opensuse-tumbleweed-src diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/AUTHORS new/glean-1.18.0/AUTHORS --- old/glean-1.15.0/AUTHORS 2019-08-22 01:19:00.000000000 +0200 +++ new/glean-1.18.0/AUTHORS 2020-04-21 22:17:49.000000000 +0200 @@ -1,15 +1,20 @@ +Andreas Jaeger <a...@suse.com> Cao Xuan Hoang <hoan...@vn.fujitsu.com> Chris Jones <c...@tenshu.net> Chris Krelle <nobody...@gmail.com> Clark Boylan <clark.boy...@gmail.com> Clint Byrum <cl...@fewbar.com> +Colleen Murphy <colleen.mur...@suse.de> CullenTaylor <mctay...@us.ibm.com> +Dirk Mueller <d...@dmllr.de> Gregory Haynes <g...@greghaynes.net> Ian Wienand <iwien...@redhat.com> +Ilya Etingof <etin...@gmail.com> James E. Blair <jebl...@redhat.com> Jamie Lennox <jamielen...@gmail.com> John L. Villalovos <john.l.villalo...@intel.com> Julia Kreger <juliaashleykre...@gmail.com> +Lars Kellogg-Stedman <l...@redhat.com> Markos Chandras <mchand...@suse.de> Matt Mulsow <mamul...@us.ibm.com> Matthew Mulsow <mamul...@softlayer.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/ChangeLog new/glean-1.18.0/ChangeLog --- old/glean-1.15.0/ChangeLog 2019-08-22 01:19:00.000000000 +0200 +++ new/glean-1.18.0/ChangeLog 2020-04-21 22:17:49.000000000 +0200 @@ -1,6 +1,26 @@ CHANGES ======= +1.18.0 +------ + +* write one resolv config +* Switch to Fedora 30 jobs +* Fix a handful of bugs in config-drive processing +* Remove trusty job +* Move opensuse jobs to experimental for now + +1.17.0 +------ + +* Add support for SLES + +1.16.0 +------ + +* Do not bring up udev assigned interfaces +* Update testing to opensuse 15 + 1.15.0 ------ @@ -31,6 +51,7 @@ * Add NetworkManager distro plugin support * fix tox python3 overrides * write dns info to networkd +* changes for alpine compatibility * Pass arguments rather than distro to utility functions * Fix argv patching in unit tests * check networkd files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/PKG-INFO new/glean-1.18.0/PKG-INFO --- old/glean-1.15.0/PKG-INFO 2019-08-22 01:19:01.000000000 +0200 +++ new/glean-1.18.0/PKG-INFO 2020-04-21 22:17:49.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: glean -Version: 1.15.0 +Version: 1.18.0 Summary: Simple program to write static config from config-drive Home-page: http://www.openstack.org/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/cmd.py new/glean-1.18.0/glean/cmd.py --- old/glean-1.15.0/glean/cmd.py 2019-08-22 01:18:13.000000000 +0200 +++ new/glean-1.18.0/glean/cmd.py 2020-04-21 22:17:14.000000000 +0200 @@ -76,8 +76,8 @@ def _is_suse(distro): # 'distro could be any of suse, opensuse, - # opensuse-leap, opensuse-tumbleweed - return 'suse' in distro + # opensuse-leap, opensuse-tumbleweed, sles + return 'suse' in distro or 'sles' in distro def _network_files(distro): @@ -319,7 +319,7 @@ continue inter_macs = [intf['mac_address'] for intf in interfaces.values()] link_macs = [intf.get('link_mac') for intf in interfaces.values() - if 'vlan_id' in interface] + if 'vlan_id' in intf] if mac in inter_macs or mac in link_macs: # We have a config drive config, move on log.debug("%s configured via config-drive" % mac) @@ -934,7 +934,7 @@ continue inter_macs = [intf['mac_address'] for intf in interfaces.values()] link_macs = [intf.get('link_mac') for intf in interfaces.values() - if 'vlan_id' in interface] + if 'vlan_id' in intf] if mac in inter_macs or mac in link_macs: # We have a config drive config, move on continue @@ -945,15 +945,26 @@ def write_dns_info(dns_servers): + # will fail on non-systemd systems (what we want) + # will exit 1 if not enabled (what we want) + # will exit 0 if enabled (or indirectly enabled) + resolved_enabled = os.system('systemctl is-enabled systemd-resolved') resolve_confs = {} - resolv_nameservers = "" - for server in dns_servers: - resolv_nameservers += "nameserver {0}\n".format(server) - resolve_confs['/etc/resolv.conf'] = resolv_nameservers - # set up resolved if available - if os.path.isfile('/etc/systemd/resolved.conf'): + # write resolv.conf if the file can be written to (if symlink is pointing + # to a non-existant file, writing will fail), will return false if the + # pointer is incomplete + if resolved_enabled != 0: + log.debug("resolved not in use, writing to /etc/resolv.conf") + resolv_nameservers = "" + for server in dns_servers: + resolv_nameservers += "nameserver {0}\n".format(server) + resolve_confs['/etc/resolv.conf'] = resolv_nameservers + # set up resolved if enabled + if resolved_enabled == 0: + log.debug("resolved in use, writing to /etc/systemd/resolved.conf") # read the existing config so we only overwrite what's needed resolved_conf = configparser.ConfigParser() + resolved_conf.optionxform = str resolved_conf.read('/etc/systemd/resolved.conf') # create config section if not created if not resolved_conf.has_section('Resolve'): @@ -1003,6 +1014,11 @@ for phy in vlan_link['bond_links']: link['raw_macs'].append( phys[phy]['ethernet_mac_address'].lower()) + else: + log.warning('vlan_link=%s not matching any ' + 'NIC', link['vlan_link']) + continue + link['mac_address'] = link.pop( 'vlan_mac_address', vlan_link['ethernet_mac_address']).lower() @@ -1104,7 +1120,7 @@ os.unlink(k) retries = 1 continue - elif e.errno == errno.EACCESS: + elif e.errno == errno.EACCES: log.debug(" ... is read only, skipped") break else: @@ -1124,9 +1140,12 @@ def interface_live(iface, sys_root, args): - log.debug("Checking if interface %s has an active link carrier." % iface) + log.debug("Checking status of interface %s" % iface) if is_interface_live(iface, sys_root): + log.debug("%s has active carrier, including", iface) return True + else: + log.debug("%s does not have active carrier", iface) if args.noop: return False @@ -1185,9 +1204,13 @@ ignored_interfaces = ('sit', 'tunl', 'bonding_master', 'teql', 'wg', 'ip6gre', 'ip6_vti', 'ip6tnl', 'bond', 'lo') sys_interfaces = {} + + called_from_udev = False if interface is not None: log.debug("Only considering interface %s from arguments" % interface) interfaces = [interface] + # see notes below... + called_from_udev = True else: interfaces = [f for f in os.listdir(sys_root) if not f.startswith(ignored_interfaces)] @@ -1212,9 +1235,48 @@ # glean. if mac_addr_type != PERMANENT_ADDR_TYPE: continue + + mac = open('%s/%s/address' % (sys_root, iface), 'r').read().strip() + + # Hack alert! If we have been given a single interface + # argument (hence called_from_udev is true), that means we + # have been called for just one nic by udev in response to the + # "net" "add" action matching. We are going to assume that if + # we made it this far (i.e. past the filters above) this + # interface should be configured. + # + # It is unclear, as at 2019-10, if there are active jobs + # relying on the "probe" path below. The only way to get into + # this path is being called from init scripts on a pre-systemd + # platform that does not use udev activiation; this would mean + # (as at this writing) Trusty (CentOS 6 being long gone). + # + # In short, it tries to bring up *all* the interfaces, and if + # they don't come up, it figures they're not valid and + # excludes them. This introduces a very tricky race -- by + # bringing the interface up it can start accepting RA + # broadcasts and possibly have the kernel configure it with an + # ipv6 addresses. Then, network-manager will see the + # interface is already configured, and out of an abdundance of + # caution, refuse to re-configure it. You end up with broken + # networking. + # + # This is racy; you might get lucky and the RA timeout is long + # enough that network-manager starts before this happens. So + # it is not exactly correct to say that the probe path is + # completely broken; it is possible users have just not + # noticed or are tacitly relying on it. + # + # While we consider this, assuming that if we are called from + # udev that the interface is to be configured here, and not + # bringing it "up", avoids this issue. + if called_from_udev: + log.debug("Interface matched: %s (%s)", iface, mac) + sys_interfaces[mac] = iface + return sys_interfaces + # check if interface is up if not try and bring it up if interface_live(iface, sys_root, args): - mac = open('%s/%s/address' % (sys_root, iface), 'r').read().strip() if_dict[iface] = mac # wait up to 9 seconds all interfaces to reach up @@ -1225,6 +1287,7 @@ mac = if_dict[iface] if iface in if_up_list: continue + log.debug("Checking liveness of %s", mac) if is_interface_live(iface, sys_root): # Add system interface sys_interfaces[mac] = iface @@ -1243,8 +1306,11 @@ continue msg = "Skipping system interface %s (%s)" % (iface, if_dict[iface]) - log.warn(msg) + log.warning(msg) + log.debug("WARNING: interfaces have been brought 'up' during the probing" + "process. This may cause problems if IPv6 RA have" + "been accepted") return sys_interfaces diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/init/glean.openrc new/glean-1.18.0/glean/init/glean.openrc --- old/glean-1.15.0/glean/init/glean.openrc 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/init/glean.openrc 2020-04-21 22:17:14.000000000 +0200 @@ -1,4 +1,4 @@ -#!/sbin/runscript +#!/sbin/openrc-run # Copyright 1999-2016 Gentoo Foundation # $Id$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/init/glean.sh new/glean-1.18.0/glean/init/glean.sh --- old/glean-1.15.0/glean/init/glean.sh 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/init/glean.sh 2020-04-21 22:17:14.000000000 +0200 @@ -37,7 +37,9 @@ BLOCKDEV="$(blkid -L ${CONFIG_DRIVE_LABEL})" TYPE="$(blkid -t LABEL=${CONFIG_DRIVE_LABEL} -s TYPE -o value)" if [[ "${TYPE}" == 'vfat' ]]; then - mount -o umask=0077 "${BLOCKDEV}" /mnt/config || true + mount -t vfat -o umask=0077 "${BLOCKDEV}" /mnt/config || true + elif [[ "${TYPE}" == 'iso9660' ]]; then + mount -t iso9660 -o ro,mode=0700 "${BLOCKDEV}" /mnt/config || true else mount -o mode=0700 "${BLOCKDEV}" /mnt/config || true fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/tests/fixtures/test/liberty.networkd.network.out new/glean-1.18.0/glean/tests/fixtures/test/liberty.networkd.network.out --- old/glean-1.15.0/glean/tests/fixtures/test/liberty.networkd.network.out 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/tests/fixtures/test/liberty.networkd.network.out 2020-04-21 22:17:14.000000000 +0200 @@ -1,6 +1,7 @@ -### Write /etc/resolv.conf -nameserver 72.3.128.241 -nameserver 72.3.128.240 +### Write /etc/systemd/resolved.conf +[Resolve] +DNS = 72.3.128.241 72.3.128.240 + ### Write /etc/systemd/network/eth0.network # Automatically generated, do not edit [Match] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/tests/fixtures/test/rax-iad.networkd.network.out new/glean-1.18.0/glean/tests/fixtures/test/rax-iad.networkd.network.out --- old/glean-1.15.0/glean/tests/fixtures/test/rax-iad.networkd.network.out 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/tests/fixtures/test/rax-iad.networkd.network.out 2020-04-21 22:17:14.000000000 +0200 @@ -1,6 +1,7 @@ -### Write /etc/resolv.conf -nameserver 69.20.0.196 -nameserver 69.20.0.164 +### Write /etc/systemd/resolved.conf +[Resolve] +DNS = 69.20.0.196 69.20.0.164 + ### Write /etc/systemd/network/eth0.network # Automatically generated, do not edit [Match] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/tests/fixtures/test/rax-iad.networkd.network.out.dns new/glean-1.18.0/glean/tests/fixtures/test/rax-iad.networkd.network.out.dns --- old/glean-1.15.0/glean/tests/fixtures/test/rax-iad.networkd.network.out.dns 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/tests/fixtures/test/rax-iad.networkd.network.out.dns 2020-04-21 22:17:14.000000000 +0200 @@ -1,6 +1,7 @@ -### Write /etc/resolv.conf -nameserver 69.20.0.196 -nameserver 69.20.0.164 +### Write /etc/systemd/resolved.conf +[Resolve] +DNS = 69.20.0.196 69.20.0.164 + ### Write /etc/systemd/network/eth0.network # Automatically generated, do not edit [Match] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/tests/fixtures/test/rax.networkd.network.out new/glean-1.18.0/glean/tests/fixtures/test/rax.networkd.network.out --- old/glean-1.15.0/glean/tests/fixtures/test/rax.networkd.network.out 2019-08-22 01:18:09.000000000 +0200 +++ new/glean-1.18.0/glean/tests/fixtures/test/rax.networkd.network.out 2020-04-21 22:17:14.000000000 +0200 @@ -1,6 +1,7 @@ -### Write /etc/resolv.conf -nameserver 72.3.128.241 -nameserver 72.3.128.240 +### Write /etc/systemd/resolved.conf +[Resolve] +DNS = 72.3.128.241 72.3.128.240 + ### Write /etc/systemd/network/eth0.network # Automatically generated, do not edit [Match] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean/tests/test_glean.py new/glean-1.18.0/glean/tests/test_glean.py --- old/glean-1.15.0/glean/tests/test_glean.py 2019-08-22 01:18:13.000000000 +0200 +++ new/glean-1.18.0/glean/tests/test_glean.py 2020-04-21 22:17:14.000000000 +0200 @@ -142,6 +142,13 @@ return False return real_path_exists(path) + def os_system_side_effect(self, distro, command): + if distro.lower() != 'networkd' and \ + command == 'systemctl is-enabled systemd-resolved': + return 3 + else: + return 0 + @mock.patch('subprocess.call', return_value=0, new_callable=mock.Mock) @mock.patch('os.fsync', return_value=0, new_callable=mock.Mock) @mock.patch('os.unlink', return_value=0, new_callable=mock.Mock) @@ -183,6 +190,10 @@ self.os_listdir_side_effect, provider) mock_open.side_effect = functools.partial( self.open_side_effect, provider) + # we want os.system to return False for specific commands if + # running networkd + mock_os_system.side_effect = functools.partial( + self.os_system_side_effect, distro) # default args argv = ['--hostname'] @@ -234,6 +245,9 @@ if skip_dns and '/etc/resolv.conf' in dest: self.assertNotIn(dest, self.file_handle_mocks) continue + if skip_dns and '/etc/systemd/resolved.conf' in dest: + self.assertNotIn(dest, self.file_handle_mocks) + continue self.assertIn(dest, self.file_handle_mocks) write_handle = self.file_handle_mocks[dest].write write_handle.assert_called_once_with(content) @@ -279,6 +293,10 @@ self._assert_distro_provider(self.distro, self.style, 'eth0', skip_dns=True) + def test_glean_systemd_resolved(self): + with mock.patch('glean.systemlock.Lock'): + self._assert_distro_provider(self.distro, self.style, 'eth0') + def test_glean_skip_dns(self): with mock.patch('glean.systemlock.Lock'): self._assert_distro_provider( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean.egg-info/PKG-INFO new/glean-1.18.0/glean.egg-info/PKG-INFO --- old/glean-1.15.0/glean.egg-info/PKG-INFO 2019-08-22 01:19:00.000000000 +0200 +++ new/glean-1.18.0/glean.egg-info/PKG-INFO 2020-04-21 22:17:49.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: glean -Version: 1.15.0 +Version: 1.18.0 Summary: Simple program to write static config from config-drive Home-page: http://www.openstack.org/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glean-1.15.0/glean.egg-info/pbr.json new/glean-1.18.0/glean.egg-info/pbr.json --- old/glean-1.15.0/glean.egg-info/pbr.json 2019-08-22 01:19:00.000000000 +0200 +++ new/glean-1.18.0/glean.egg-info/pbr.json 2020-04-21 22:17:49.000000000 +0200 @@ -1 +1 @@ -{"git_version": "68f25b6", "is_release": true} \ No newline at end of file +{"git_version": "d0f8a75", "is_release": true} \ No newline at end of file