Dominique Leuenberger 2019-06-24 19:48:51 +00:00 committed by Git OBS Bridge
commit 522b534b46
12 changed files with 229 additions and 780 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:650d1eb38ea488b3ea8cc9d7b0fb975bb3c9a3e5ca7dcaf924892f5f9813da92
size 990381

3
cloud-init-19.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75be8cbff1431883227c05356cb69400f20bbb2666fd05e085f846ecf1d153cb
size 1017682

View File

@ -0,0 +1,57 @@
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
index 8c18aa1..7575223 100644
--- a/tests/unittests/test_ds_identify.py
+++ b/tests/unittests/test_ds_identify.py
@@ -435,6 +435,14 @@ class TestDsIdentify(DsIdentifyBase):
"""Open Telecom identification."""
self._test_ds_found('OpenStack-OpenTelekom')
+ def test_openstack_asset_tag_nova(self):
+ """OpenStack identification via asset tag OpenStack Nova."""
+ self._test_ds_found('OpenStack-AssetTag-Nova')
+
+ def test_openstack_asset_tag_copute(self):
+ """OpenStack identification via asset tag OpenStack Compute."""
+ self._test_ds_found('OpenStack-AssetTag-Compute')
+
def test_openstack_on_non_intel_is_maybe(self):
"""On non-Intel, openstack without dmi info is maybe.
@@ -759,6 +767,18 @@ VALID_CFG = {
'files': {P_CHASSIS_ASSET_TAG: 'OpenTelekomCloud\n'},
'mocks': [MOCK_VIRT_IS_XEN],
},
+ 'OpenStack-AssetTag-Nova': {
+ # VMware vSphere can't modify product-name, LP: #1669875
+ 'ds': 'OpenStack',
+ 'files': {P_CHASSIS_ASSET_TAG: 'OpenStack Nova\n'},
+ 'mocks': [MOCK_VIRT_IS_XEN],
+ },
+ 'OpenStack-AssetTag-Compute': {
+ # VMware vSphere can't modify product-name, LP: #1669875
+ 'ds': 'OpenStack',
+ 'files': {P_CHASSIS_ASSET_TAG: 'OpenStack Compute\n'},
+ 'mocks': [MOCK_VIRT_IS_XEN],
+ },
'OVF-seed': {
'ds': 'OVF',
'files': {
diff --git a/tools/ds-identify b/tools/ds-identify
index 6518901..e16708f 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -979,6 +979,14 @@ dscheck_OpenStack() {
return ${DS_FOUND}
fi
+ # LP: #1669875 : allow identification of OpenStack by asset tag
+ if dmi_chassis_asset_tag_matches "$nova"; then
+ return ${DS_FOUND}
+ fi
+ if dmi_chassis_asset_tag_matches "$compute"; then
+ return ${DS_FOUND}
+ fi
+
# LP: #1715241 : arch other than intel are not identified properly.
case "$DI_UNAME_MACHINE" in
i?86|x86_64) :;;

View File

@ -1,189 +0,0 @@
--- cloudinit/net/network_state.py.orig
+++ cloudinit/net/network_state.py
@@ -148,6 +148,7 @@ class NetworkState(object):
self._network_state = copy.deepcopy(network_state)
self._version = version
self.use_ipv6 = network_state.get('use_ipv6', False)
+ self._has_default_route = self._find_default_route()
@property
def config(self):
@@ -157,6 +158,10 @@ class NetworkState(object):
def version(self):
return self._version
+ @property
+ def has_default_route(self):
+ return self._has_default_route
+
def iter_routes(self, filter_func=None):
for route in self._network_state.get('routes', []):
if filter_func is not None:
@@ -188,6 +193,23 @@ class NetworkState(object):
if filter_func(iface):
yield iface
+ def _find_default_route(self):
+ for route in self.iter_routes():
+ if self._is_default_route(route):
+ return True
+ for iface in self.iter_interfaces():
+ for subnet in iface.get('subnets', []):
+ for route in subnet.get('routes', []):
+ if self._is_default_route(route):
+ return True
+
+ def _is_default_route(self, route):
+ default_nets = ('::', '0.0.0.0')
+ return (
+ route.get('prefix') == 0 and
+ route.get('network') in default_nets
+ )
+
@six.add_metaclass(CommandHandlerMeta)
class NetworkStateInterpreter(object):
--- cloudinit/net/sysconfig.py.orig
+++ cloudinit/net/sysconfig.py
@@ -310,6 +310,7 @@ class Renderer(renderer.Renderer):
mtu_key = 'MTU'
subnet_type = subnet.get('type')
if subnet_type == 'dhcp6':
+ # TODO need to set BOOTPROTO to dhcp6 on SUSE
iface_cfg['IPV6INIT'] = True
iface_cfg['DHCPV6C'] = True
elif subnet_type in ['dhcp4', 'dhcp']:
@@ -355,9 +356,12 @@ class Renderer(renderer.Renderer):
ipv6_index = -1
for i, subnet in enumerate(subnets, start=len(iface_cfg.children)):
subnet_type = subnet.get('type')
- if subnet_type == 'dhcp6':
- continue
- elif subnet_type in ['dhcp4', 'dhcp']:
+ if subnet_type in ['dhcp', 'dhcp4', 'dhcp6']:
+ if (
+ cls._network_default_route and
+ iface_cfg['BOOTPROTO'] != 'none'
+ ):
+ iface_cfg['DHCLIENT_SET_DEFAULT_ROUTE'] = False
continue
elif subnet_type == 'static':
if subnet_is_ipv6(subnet):
@@ -423,6 +427,8 @@ class Renderer(renderer.Renderer):
# TODO(harlowja): add validation that no other iface has
# also provided the default route?
iface_cfg['DEFROUTE'] = True
+ if iface_cfg['BOOTPROTO'] in ('dhcp', 'dhcp4', 'dhcp6'):
+ iface_cfg['DHCLIENT_SET_DEFAULT_ROUTE'] = True
if 'gateway' in route:
if is_ipv6 or is_ipv6_addr(route['gateway']):
iface_cfg['IPV6_DEFAULTGW'] = route['gateway']
@@ -636,6 +642,10 @@ class Renderer(renderer.Renderer):
return contents
def render_network_state(self, network_state, templates=None, target=None):
+ # Force the knowledge of a default route for the network state
+ # into the renderer, this is needed to write the proper ifcfg-
+ # on SUSE distros
+ self.__class__._network_default_route = network_state.has_default_route
if not templates:
templates = self.templates
file_mode = 0o644
--- tests/unittests/test_net.py.orig
+++ tests/unittests/test_net.py
@@ -538,6 +538,7 @@ NETWORK_CONFIGS = {
BOOTPROTO=dhcp
DEFROUTE=yes
DEVICE=eth99
+ DHCLIENT_SET_DEFAULT_ROUTE=yes
DNS1=8.8.8.8
DNS2=8.8.4.4
DOMAIN="barley.maas sach.maas"
@@ -912,6 +913,7 @@ pre-down route del -net 10.0.0.0 netmask
'ifcfg-bond0.200': textwrap.dedent("""\
BOOTPROTO=dhcp
DEVICE=bond0.200
+ DHCLIENT_SET_DEFAULT_ROUTE=no
NM_CONTROLLED=no
ONBOOT=yes
STARTMODE=auto
@@ -1011,6 +1013,7 @@ pre-down route del -net 10.0.0.0 netmask
'ifcfg-eth5': textwrap.dedent("""\
BOOTPROTO=dhcp
DEVICE=eth5
+ DHCLIENT_SET_DEFAULT_ROUTE=no
HWADDR=98:bb:9f:2c:e8:8a
NM_CONTROLLED=no
ONBOOT=no
@@ -1666,6 +1669,23 @@ CONFIG_V1_SIMPLE_SUBNET = {
'type': 'static'}],
'type': 'physical'}]}
+CONFIG_V1_MULTI_IFACE = {
+ 'version': 1,
+ 'config': [{'type': 'physical',
+ 'mtu': 1500,
+ 'subnets': [{'type': 'static',
+ 'netmask': '255.255.240.0',
+ 'routes': [{'netmask': '0.0.0.0',
+ 'network': '0.0.0.0',
+ 'gateway': '51.68.80.1'}],
+ 'address': '51.68.89.122',
+ 'ipv4': True}],
+ 'mac_address': 'fa:16:3e:25:b4:59',
+ 'name': 'eth0'},
+ {'type': 'physical',
+ 'mtu': 9000,
+ 'subnets': [{'type': 'dhcp4'}],
+ 'mac_address': 'fa:16:3e:b1:ca:29', 'name': 'eth1'}]}
DEFAULT_DEV_ATTRS = {
'eth1000': {
@@ -2133,6 +2153,47 @@ USERCTL=no
"""
self.assertEqual(expected, found[nspath + 'ifcfg-interface0'])
+ def test_network_config_v1_multi_iface_samples(self):
+ ns = network_state.parse_net_config_data(CONFIG_V1_MULTI_IFACE)
+ render_dir = self.tmp_path("render")
+ os.makedirs(render_dir)
+ renderer = self._get_renderer()
+ renderer.render_network_state(ns, target=render_dir)
+ found = dir2dict(render_dir)
+ nspath = '/etc/sysconfig/network-scripts/'
+ self.assertNotIn(nspath + 'ifcfg-lo', found.keys())
+ expected_i1 = """\
+# Created by cloud-init on instance boot automatically, do not edit.
+#
+BOOTPROTO=none
+DEFROUTE=yes
+DEVICE=eth0
+GATEWAY=51.68.80.1
+HWADDR=fa:16:3e:25:b4:59
+IPADDR=51.68.89.122
+MTU=1500
+NETMASK=255.255.240.0
+NM_CONTROLLED=no
+ONBOOT=yes
+TYPE=Ethernet
+USERCTL=no
+"""
+ self.assertEqual(expected_i1, found[nspath + 'ifcfg-eth0'])
+ expected_i2 = """\
+# Created by cloud-init on instance boot automatically, do not edit.
+#
+BOOTPROTO=dhcp
+DEVICE=eth1
+DHCLIENT_SET_DEFAULT_ROUTE=no
+HWADDR=fa:16:3e:b1:ca:29
+MTU=9000
+NM_CONTROLLED=no
+ONBOOT=yes
+TYPE=Ethernet
+USERCTL=no
+"""
+ self.assertEqual(expected_i2, found[nspath + 'ifcfg-eth1'])
+
def test_config_with_explicit_loopback(self):
ns = network_state.parse_net_config_data(CONFIG_V1_EXPLICIT_LOOPBACK)
render_dir = self.tmp_path("render")

View File

@ -1,21 +0,0 @@
--- cloudinit/net/sysconfig.py.orig
+++ cloudinit/net/sysconfig.py
@@ -545,6 +545,8 @@ class Renderer(renderer.Renderer):
content.add_nameserver(nameserver)
for searchdomain in network_state.dns_searchdomains:
content.add_search_domain(searchdomain)
+ if not str(content):
+ return str(content)
header = _make_header(';')
content_str = str(content)
if not content_str.startswith(header):
@@ -658,7 +660,8 @@ class Renderer(renderer.Renderer):
dns_path = util.target_path(target, self.dns_path)
resolv_content = self._render_dns(network_state,
existing_dns_path=dns_path)
- util.write_file(dns_path, resolv_content, file_mode)
+ if resolv_content:
+ util.write_file(dns_path, resolv_content, file_mode)
if self.networkmanager_conf_path:
nm_conf_path = util.target_path(target,
self.networkmanager_conf_path)

View File

@ -1,112 +0,0 @@
--- cloudinit/net/sysconfig.py.orig
+++ cloudinit/net/sysconfig.py
@@ -369,10 +369,13 @@ class Renderer(renderer.Renderer):
ipv6_cidr = "%s/%s" % (subnet['address'], subnet['prefix'])
if ipv6_index == 0:
iface_cfg['IPV6ADDR'] = ipv6_cidr
+ iface_cfg['IPADDR6'] = ipv6_cidr
elif ipv6_index == 1:
iface_cfg['IPV6ADDR_SECONDARIES'] = ipv6_cidr
+ iface_cfg['IPADDR6_0'] = ipv6_cidr
else:
iface_cfg['IPV6ADDR_SECONDARIES'] += " " + ipv6_cidr
+ iface_cfg['IPADDR6_%d' % ipv6_index] = ipv6_cidr
else:
ipv4_index = ipv4_index + 1
suff = "" if ipv4_index == 0 else str(ipv4_index)
--- tests/unittests/test_distros/test_netconfig.py.orig
+++ tests/unittests/test_distros/test_netconfig.py
@@ -496,6 +496,7 @@ class TestNetCfgDistroRedhat(TestNetCfgD
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
+ IPADDR6=2607:f0d0:1002:0011::2/64
IPV6ADDR=2607:f0d0:1002:0011::2/64
IPV6INIT=yes
IPV6_DEFAULTGW=2607:f0d0:1002:0011::1
@@ -588,6 +589,7 @@ class TestNetCfgDistroOpensuse(TestNetCf
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
+ IPADDR6=2607:f0d0:1002:0011::2/64
IPV6ADDR=2607:f0d0:1002:0011::2/64
IPV6INIT=yes
IPV6_DEFAULTGW=2607:f0d0:1002:0011::1
--- tests/unittests/test_net.py.orig
+++ tests/unittests/test_net.py
@@ -369,6 +369,9 @@ DEVICE=eth0
GATEWAY=172.19.3.254
HWADDR=fa:16:3e:ed:9a:59
IPADDR=172.19.1.34
+IPADDR6=2001:DB8::10/64
+IPADDR6_0=2001:DB9::10/64
+IPADDR6_2=2001:DB10::10/64
IPV6ADDR=2001:DB8::10/64
IPV6ADDR_SECONDARIES="2001:DB9::10/64 2001:DB10::10/64"
IPV6INIT=yes
@@ -407,6 +410,9 @@ DEVICE=eth0
GATEWAY=172.19.3.254
HWADDR=fa:16:3e:ed:9a:59
IPADDR=172.19.1.34
+IPADDR6=2001:DB8::10/64
+IPADDR6_0=2001:DB9::10/64
+IPADDR6_2=2001:DB10::10/64
IPV6ADDR=2001:DB8::10/64
IPV6ADDR_SECONDARIES="2001:DB9::10/64 2001:DB10::10/64"
IPV6INIT=yes
@@ -658,6 +664,7 @@ NETWORK_CONFIGS = {
BOOTPROTO=none
DEVICE=iface0
IPADDR=192.168.14.2
+ IPADDR6=2001:1::1/64
IPV6ADDR=2001:1::1/64
IPV6INIT=yes
NETMASK=255.255.255.0
@@ -927,6 +934,7 @@ pre-down route del -net 10.0.0.0 netmask
DEFROUTE=yes
DEVICE=br0
IPADDR=192.168.14.2
+ IPADDR6=2001:1::1/64
IPV6ADDR=2001:1::1/64
IPV6INIT=yes
IPV6_DEFAULTGW=2001:4800:78ff:1b::1
@@ -1322,6 +1330,7 @@ pre-down route del -net 10.0.0.0 netmask
MACADDR=aa:bb:cc:dd:e8:ff
IPADDR=192.168.0.2
IPADDR1=192.168.1.2
+ IPADDR6=2001:1::1/92
IPV6ADDR=2001:1::1/92
IPV6INIT=yes
MTU=9000
@@ -1377,6 +1386,7 @@ pre-down route del -net 10.0.0.0 netmask
MACADDR=aa:bb:cc:dd:e8:ff
IPADDR=192.168.0.2
IPADDR1=192.168.1.2
+ IPADDR6=2001:1::1/92
IPV6ADDR=2001:1::1/92
IPV6INIT=yes
MTU=9000
@@ -1467,6 +1477,7 @@ pre-down route del -net 10.0.0.0 netmask
GATEWAY=192.168.1.1
IPADDR=192.168.2.2
IPADDR1=192.168.1.2
+ IPADDR6=2001:1::100/96
IPV6ADDR=2001:1::bbbb/96
IPV6INIT=yes
IPV6_DEFAULTGW=2001:1::1
@@ -1528,6 +1539,7 @@ pre-down route del -net 10.0.0.0 netmask
BRIDGE=br0
DEVICE=eth0
HWADDR=52:54:00:12:34:00
+ IPADDR6=2001:1::100/96
IPV6ADDR=2001:1::100/96
IPV6INIT=yes
NM_CONTROLLED=no
@@ -1541,6 +1553,7 @@ pre-down route del -net 10.0.0.0 netmask
BRIDGE=br0
DEVICE=eth1
HWADDR=52:54:00:12:34:01
+ IPADDR6=2001:1::101/96
IPV6ADDR=2001:1::101/96
IPV6INIT=yes
NM_CONTROLLED=no

View File

@ -1,6 +1,14 @@
--- cloudinit/util.py.orig
+++ cloudinit/util.py
@@ -1920,7 +1920,8 @@ def subp(args, data=None, rcs=None, env=
@@ -35,6 +35,7 @@ import time
from errno import ENOENT, ENOEXEC
from base64 import b64decode, b64encode
+from signal import signal, SIGPIPE, SIG_DFL
from six.moves.urllib import parse as urlparse
import six
@@ -2031,7 +2032,8 @@ def subp(args, data=None, rcs=None, env=
try:
sp = subprocess.Popen(bytes_args, stdout=stdout,
stderr=stderr, stdin=stdin,

View File

@ -1,406 +0,0 @@
--- cloudinit/net/sysconfig.py.orig
+++ cloudinit/net/sysconfig.py
@@ -252,6 +252,7 @@ class Renderer(renderer.Renderer):
('USERCTL', False),
('NM_CONTROLLED', False),
('BOOTPROTO', 'none'),
+ ('STARTMODE', 'auto'),
])
# If these keys exist, then their values will be used to form
@@ -346,6 +347,7 @@ class Renderer(renderer.Renderer):
iface_cfg.name))
if subnet.get('control') == 'manual':
iface_cfg['ONBOOT'] = False
+ iface_cfg['STARTMODE'] = 'manual'
# set IPv4 and IPv6 static addresses
ipv4_index = -1
--- tests/unittests/test_distros/test_netconfig.py.orig
+++ tests/unittests/test_distros/test_netconfig.py
@@ -468,6 +468,7 @@ class TestNetCfgDistroRedhat(TestNetCfgD
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -476,6 +477,7 @@ class TestNetCfgDistroRedhat(TestNetCfgD
DEVICE=eth1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -499,6 +501,7 @@ class TestNetCfgDistroRedhat(TestNetCfgD
IPV6_DEFAULTGW=2607:f0d0:1002:0011::1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -507,6 +510,7 @@ class TestNetCfgDistroRedhat(TestNetCfgD
DEVICE=eth1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -559,6 +563,7 @@ class TestNetCfgDistroOpensuse(TestNetCf
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -567,6 +572,7 @@ class TestNetCfgDistroOpensuse(TestNetCf
DEVICE=eth1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -587,6 +593,7 @@ class TestNetCfgDistroOpensuse(TestNetCf
IPV6_DEFAULTGW=2607:f0d0:1002:0011::1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -595,6 +602,7 @@ class TestNetCfgDistroOpensuse(TestNetCf
DEVICE=eth1
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
--- tests/unittests/test_net.py.orig
+++ tests/unittests/test_net.py
@@ -144,6 +144,7 @@ IPADDR=172.19.1.34
NETMASK=255.255.252.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -177,6 +178,7 @@ IPADDR=172.19.1.34
NETMASK=255.255.252.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -246,6 +248,7 @@ NETMASK=255.255.252.0
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -281,6 +284,7 @@ NETMASK=255.255.252.0
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -372,6 +376,7 @@ IPV6_DEFAULTGW=2001:DB8::1
NETMASK=255.255.252.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -409,6 +414,7 @@ IPV6_DEFAULTGW=2001:DB8::1
NETMASK=255.255.252.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()),
@@ -525,6 +531,7 @@ NETWORK_CONFIGS = {
HWADDR=cf:d6:af:48:e8:80
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
'ifcfg-eth99': textwrap.dedent("""\
@@ -541,6 +548,7 @@ NETWORK_CONFIGS = {
METRIC=10000
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
},
@@ -654,6 +662,7 @@ NETWORK_CONFIGS = {
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
MTU=9000
@@ -693,6 +702,7 @@ NETWORK_CONFIGS = {
DEVICE=iface0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -896,6 +906,7 @@ pre-down route del -net 10.0.0.0 netmask
MACADDR=aa:bb:cc:dd:ee:ff
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Bond
USERCTL=no"""),
'ifcfg-bond0.200': textwrap.dedent("""\
@@ -903,6 +914,7 @@ pre-down route del -net 10.0.0.0 netmask
DEVICE=bond0.200
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
PHYSDEV=bond0
TYPE=Ethernet
USERCTL=no
@@ -920,6 +932,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
PRIO=22
STP=no
TYPE=Bridge
@@ -930,6 +943,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=c0:d6:9f:2c:e8:80
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
'ifcfg-eth0.101': textwrap.dedent("""\
@@ -947,6 +961,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
PHYSDEV=eth0
TYPE=Ethernet
USERCTL=no
@@ -958,6 +973,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no"""),
@@ -968,6 +984,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no"""),
@@ -978,6 +995,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=66:bb:9f:2c:e8:80
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
'ifcfg-eth4': textwrap.dedent("""\
@@ -987,6 +1005,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=98:bb:9f:2c:e8:80
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
'ifcfg-eth5': textwrap.dedent("""\
@@ -995,6 +1014,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=98:bb:9f:2c:e8:8a
NM_CONTROLLED=no
ONBOOT=no
+ STARTMODE=manual
TYPE=Ethernet
USERCTL=no""")
},
@@ -1306,6 +1326,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Bond
USERCTL=no
"""),
@@ -1316,6 +1337,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no
@@ -1332,6 +1354,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no
@@ -1358,6 +1381,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Bond
USERCTL=no
"""),
@@ -1368,6 +1392,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no
@@ -1390,6 +1415,7 @@ pre-down route del -net 10.0.0.0 netmask
MASTER=bond0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
SLAVE=yes
TYPE=Ethernet
USERCTL=no
@@ -1428,6 +1454,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=aa:bb:cc:dd:e8:00
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no"""),
'ifcfg-en0.99': textwrap.dedent("""\
@@ -1445,6 +1472,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK1=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
PHYSDEV=en0
TYPE=Ethernet
USERCTL=no
@@ -1486,6 +1514,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
PRIO=22
STP=no
TYPE=Bridge
@@ -1500,6 +1529,7 @@ pre-down route del -net 10.0.0.0 netmask
IPV6INIT=yes
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -1512,6 +1542,7 @@ pre-down route del -net 10.0.0.0 netmask
IPV6INIT=yes
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -1586,6 +1617,7 @@ pre-down route del -net 10.0.0.0 netmask
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=no
+ STARTMODE=manual
TYPE=Ethernet
USERCTL=no
"""),
@@ -1596,6 +1628,7 @@ pre-down route del -net 10.0.0.0 netmask
MTU=1480
NM_CONTROLLED=no
ONBOOT=yes
+ STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""),
@@ -1605,6 +1638,7 @@ pre-down route del -net 10.0.0.0 netmask
HWADDR=52:54:00:12:34:ff
NM_CONTROLLED=no
ONBOOT=no
+ STARTMODE=manual
TYPE=Ethernet
USERCTL=no
"""),
@@ -1971,6 +2005,7 @@ DEVICE=eth1000
HWADDR=07-1C-C6-75-A4-BE
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()
@@ -2092,6 +2127,7 @@ IPADDR=10.0.2.15
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""
@@ -2113,6 +2149,7 @@ BOOTPROTO=dhcp
DEVICE=eth0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""
@@ -2260,6 +2297,7 @@ DEVICE=eth1000
HWADDR=07-1C-C6-75-A4-BE
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
""".lstrip()
@@ -2381,6 +2419,7 @@ IPADDR=10.0.2.15
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""
@@ -2402,6 +2441,7 @@ BOOTPROTO=dhcp
DEVICE=eth0
NM_CONTROLLED=no
ONBOOT=yes
+STARTMODE=auto
TYPE=Ethernet
USERCTL=no
"""

View File

@ -1,3 +1,14 @@
--- cloudinit/distros/opensuse.py.orig
+++ cloudinit/distros/opensuse.py
@@ -38,6 +38,8 @@ class Distro(distros.Distro):
'sysconfig': {
'control': 'etc/sysconfig/network/config',
'iface_templates': '%(base)s/network/ifcfg-%(name)s',
+ 'netrules_path': (
+ 'etc/udev/rules.d/85-persistent-net-cloud-init.rules'),
'route_templates': {
'ipv4': '%(base)s/network/ifroute-%(name)s',
'ipv6': '%(base)s/network/ifroute-%(name)s',
--- cloudinit/net/sysconfig.py.orig
+++ cloudinit/net/sysconfig.py
@@ -8,6 +8,7 @@ import six
@ -7,8 +18,8 @@
+from cloudinit import net
from cloudinit import util
from . import renderer
@@ -673,6 +674,14 @@ class Renderer(renderer.Renderer):
from configobj import ConfigObj
@@ -699,6 +700,14 @@ class Renderer(renderer.Renderer):
if nm_conf_content:
util.write_file(nm_conf_path, nm_conf_content, file_mode)
if self.netrules_path:
@ -23,14 +34,3 @@
netrules_content = self._render_persistent_net(network_state)
netrules_path = util.target_path(target, self.netrules_path)
util.write_file(netrules_path, netrules_content, file_mode)
--- cloudinit/distros/opensuse.py.orig
+++ cloudinit/distros/opensuse.py
@@ -38,6 +38,8 @@ class Distro(distros.Distro):
'sysconfig': {
'control': 'etc/sysconfig/network/config',
'iface_templates': '%(base)s/network/ifcfg-%(name)s',
+ 'netrules_path': (
+ 'etc/udev/rules.d/85-persistent-net-cloud-init.rules'),
'route_templates': {
'ipv4': '%(base)s/network/ifroute-%(name)s',
'ipv6': '%(base)s/network/ifroute-%(name)s',

View File

@ -1,3 +1,140 @@
-------------------------------------------------------------------
Tue Jun 11 12:37:16 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>
- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
shortcut the build queues by allowing usage of systemd-mini
-------------------------------------------------------------------
Fri May 31 12:42:49 UTC 2019 - Robert Schweikert <rjschwei@suse.com>
- Update to version 19.1 (bsc#1136440)
+ Remove, included upstream
- fix-default-systemd-unit-dir.patch
- cloud-init-sysconf-ethsetup.patch
- cloud-init-handle-def-route-set.patch
- cloud-init-no-empty-resolv.patch
- cloud-init-proper-ipv6-varname.patch
+ Forward port
- cloud-init-trigger-udev.patch
+ Add cloud-init-detect-nova.diff (bsc#1136440)
+ Modify cloud-init-python2-sigpipe.patch, import signal and constants
+ Update spec to account for new location of bash completion
+ freebsd: add chpasswd pkg in the image [Gonéri Le Bouder]
+ tests: add Eoan release [Paride Legovini]
+ cc_mounts: check if mount -a on no-change fstab path
[Jason Zions (MSFT)] (LP: #1825596)
+ replace remaining occurrences of LOG.warn [Daniel Watkins]
+ DataSourceAzure: Adjust timeout for polling IMDS [Anh Vo]
+ Azure: Changes to the Hyper-V KVP Reporter [Anh Vo]
+ git tests: no longer show warning about safe yaml.
+ tools/read-version: handle errors [Chad Miller]
+ net/sysconfig: only indicate available on known sysconfig distros
(LP: #1819994)
+ packages: update rpm specs for new bash completion path
[Daniel Watkins] (LP: #1825444)
+ test_azure: mock util.SeLinuxGuard where needed
[Jason Zions (MSFT)] (LP: #1825253)
+ setup.py: install bash completion script in new location [Daniel Watkins]
+ mount_cb: do not pass sync and rw options to mount
[Gonéri Le Bouder] (LP: #1645824)
+ cc_apt_configure: fix typo in apt documentation [Dominic Schlegel]
+ Revert "DataSource: move update_events from a class to an instance..."
[Daniel Watkins]
+ Change DataSourceNoCloud to ignore file system label's case.
[Risto Oikarinen]
+ cmd:main.py: Fix missing 'modules-init' key in modes dict
[Antonio Romito] (LP: #1815109)
+ ubuntu_advantage: rewrite cloud-config module
+ Azure: Treat _unset network configuration as if it were absent
[Jason Zions (MSFT)] (LP: #1823084)
+ DatasourceAzure: add additional logging for azure datasource [Anh Vo]
+ cloud_tests: fix apt_pipelining test-cases
+ Azure: Ensure platform random_seed is always serializable as JSON.
[Jason Zions (MSFT)]
+ net/sysconfig: write out SUSE-compatible IPv6 config [Robert Schweikert]
+ tox: Update testenv for openSUSE Leap to 15.0 [Thomas Bechtold]
+ net: Fix ipv6 static routes when using eni renderer
[Raphael Glon] (LP: #1818669)
+ Add ubuntu_drivers config module [Daniel Watkins]
+ doc: Refresh Azure walinuxagent docs [Daniel Watkins]
+ tox: bump pylint version to latest (2.3.1) [Daniel Watkins]
+ DataSource: move update_events from a class to an instance attribute
[Daniel Watkins] (LP: #1819913)
+ net/sysconfig: Handle default route setup for dhcp configured NICs
[Robert Schweikert] (LP: #1812117)
+ DataSourceEc2: update RELEASE_BLOCKER to be more accurate
[Daniel Watkins]
+ cloud-init-per: POSIX sh does not support string subst, use sed
(LP: #1819222)
+ Support locking user with usermod if passwd is not available.
+ Example for Microsoft Azure data disk added. [Anton Olifir]
+ clean: correctly determine the path for excluding seed directory
[Daniel Watkins] (LP: #1818571)
+ helpers/openstack: Treat unknown link types as physical
[Daniel Watkins] (LP: #1639263)
+ drop Python 2.6 support and our NIH version detection [Daniel Watkins]
+ tip-pylint: Fix assignment-from-return-none errors
+ net: append type:dhcp[46] only if dhcp[46] is True in v2 netconfig
[Kurt Stieger] (LP: #1818032)
+ cc_apt_pipelining: stop disabling pipelining by default
[Daniel Watkins] (LP: #1794982)
+ tests: fix some slow tests and some leaking state [Daniel Watkins]
+ util: don't determine string_types ourselves [Daniel Watkins]
+ cc_rsyslog: Escape possible nested set [Daniel Watkins] (LP: #1816967)
+ Enable encrypted_data_bag_secret support for Chef
[Eric Williams] (LP: #1817082)
+ azure: Filter list of ssh keys pulled from fabric [Jason Zions (MSFT)]
+ doc: update merging doc with fixes and some additional details/examples
+ tests: integration test failure summary to use traceback if empty error
+ This is to fix https://bugs.launchpad.net/cloud-init/+bug/1812676
[Vitaly Kuznetsov]
+ EC2: Rewrite network config on AWS Classic instances every boot
[Guilherme G. Piccoli] (LP: #1802073)
+ netinfo: Adjust ifconfig output parsing for FreeBSD ipv6 entries
(LP: #1779672)
+ netplan: Don't render yaml aliases when dumping netplan (LP: #1815051)
+ add PyCharm IDE .idea/ path to .gitignore [Dominic Schlegel]
+ correct grammar issue in instance metadata documentation
[Dominic Schlegel] (LP: #1802188)
+ clean: cloud-init clean should not trace when run from within cloud_dir
(LP: #1795508)
+ Resolve flake8 comparison and pycodestyle over-ident issues
[Paride Legovini]
+ opennebula: also exclude epochseconds from changed environment vars
(LP: #1813641)
+ systemd: Render generator from template to account for system
differences. [Robert Schweikert]
+ sysconfig: On SUSE, use STARTMODE instead of ONBOOT
[Robert Schweikert] (LP: #1799540)
+ flake8: use ==/!= to compare str, bytes, and int literals
[Paride Legovini]
+ opennebula: exclude EPOCHREALTIME as known bash env variable with a
delta (LP: #1813383)
+ tox: fix disco httpretty dependencies for py37 (LP: #1813361)
+ run-container: uncomment baseurl in yum.repos.d/*.repo when using a
proxy [Paride Legovini]
+ lxd: install zfs-linux instead of zfs meta package
[Johnson Shi] (LP: #1799779)
+ net/sysconfig: do not write a resolv.conf file with only the header.
[Robert Schweikert]
+ net: Make sysconfig renderer compatible with Network Manager.
[Eduardo Otubo]
+ cc_set_passwords: Fix regex when parsing hashed passwords
[Marlin Cremers] (LP: #1811446)
+ net: Wait for dhclient to daemonize before reading lease file
[Jason Zions] (LP: #1794399)
+ [Azure] Increase retries when talking to Wireserver during metadata walk
[Jason Zions]
+ Add documentation on adding a datasource.
+ doc: clean up some datasource documentation.
+ ds-identify: fix wrong variable name in ovf_vmware_transport_guestinfo.
+ Scaleway: Support ssh keys provided inside an instance tag. [PORTE Loïc]
+ OVF: simplify expected return values of transport functions.
+ Vmware: Add support for the com.vmware.guestInfo OVF transport.
(LP: #1807466)
+ HACKING.rst: change contact info to Josh Powers
+ Update to pylint 2.2.2.
-------------------------------------------------------------------
Wed Apr 24 18:37:32 UTC 2019 - Robert Schweikert <rjschwei@suse.com>

View File

@ -18,7 +18,7 @@
%global configver 0.7
Name: cloud-init
Version: 18.5
Version: 19.1
Release: 0
License: GPL-3.0 and AGPL-3.0
Summary: Cloud node initialization tool
@ -29,9 +29,6 @@ Source1: rsyslog-cloud-init.cfg
# FIXME
# proposed for upstream merge
# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/356098
Patch12: fix-default-systemd-unit-dir.patch
# python2 disables SIGPIPE, causing broken pipe errors in shell scripts (bsc#903449)
Patch20: cloud-init-python2-sigpipe.patch
Patch21: cloud-init-template-py2.patch
@ -39,24 +36,16 @@ Patch29: datasourceLocalDisk.patch
Patch34: cloud-init-tests-set-exec.patch
# FIXME no proposed solution
Patch38: cloud-init-sysconf-path.patch
# FIXME (lp#1799540)
# https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/357710
Patch39: cloud-init-sysconf-ethsetup.patch
# FIXME (lp# 1800854)
Patch41: cloud-init-static-net.patch
# FIXME (lp#1801364)
Patch42: cloud-init-ostack-metadat-dencode.patch
# FIXME (lp#1812117)
Patch43: cloud-init-write-routes.patch
# Following submitted upstream
Patch44: cloud-init-handle-def-route-set.patch
# End lp#1812117
# FIXME (lp#1812853)
Patch45: cloud-init-no-empty-resolv.patch
# FIXME (lp#1817230)
Patch46: cloud-init-proper-ipv6-varname.patch
# FIXME (lp#1817368)
Patch47: cloud-init-trigger-udev.patch
# FIXME (lp#1669875) patch by mvoelker@launchpad
Patch48: cloud-init-detect-nova.diff
BuildRequires: fdupes
BuildRequires: filesystem
@ -137,8 +126,7 @@ Requires: dmidecode
%define initsys sysvinit_suse
%else
%define initsys systemd
BuildRequires: systemd
Requires: systemd
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%if 0%{?suse_version} && 0%{?suse_version} == 1220
%define systemd_prefix /lib
@ -190,7 +178,6 @@ Documentation and examples for cloud-init tools
%prep
%setup -q
%patch12
%if 0%{?suse_version} < 1315
%patch20
%patch21
@ -198,14 +185,11 @@ Documentation and examples for cloud-init tools
%patch29 -p0
%patch34
%patch38
%patch39
%patch41
%patch42
%patch43
%patch44
%patch45
%patch46
%patch47
%patch48 -p1
%build
%if 0%{?suse_version} && 0%{?suse_version} <= 1315
@ -303,7 +287,11 @@ popd
%config(noreplace) %{_sysconfdir}/cloud/templates
%{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
%{_sysconfdir}/bash_completion.d/cloud-init
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%endif
%{_datadir}/bash-completion/completions/cloud-init
%if 0%{?suse_version} && 0%{?suse_version} <= 1315
%{python_sitelib}/cloudinit
%{python_sitelib}/cloud_init-%{version}-py%{py_ver}.egg-info

View File

@ -1,13 +0,0 @@
Index: systemd/cloud-init-generator
===================================================================
--- systemd/cloud-init-generator.orig
+++ systemd/cloud-init-generator
@@ -9,7 +9,7 @@ DISABLE="disabled"
FOUND="found"
NOTFOUND="notfound"
RUN_ENABLED_FILE="$LOG_D/$ENABLE"
-CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
+CLOUD_SYSTEM_TARGET="/usr/lib/systemd/system/cloud-init.target"
CLOUD_TARGET_NAME="cloud-init.target"
# lxc sets 'container', but lets make that explicitly a global
CONTAINER="${container}"