|
|
16d12a |
From 13ee71a3add0dd2e7c60fc672134e696bd7f6a77 Mon Sep 17 00:00:00 2001
|
|
|
c1c26e |
From: Eduardo Otubo <otubo@redhat.com>
|
|
|
c1c26e |
Date: Wed, 20 Mar 2019 11:45:59 +0100
|
|
|
c1c26e |
Subject: include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
|
c1c26e |
|
|
|
c1c26e |
RH-Author: Eduardo Otubo <otubo@redhat.com>
|
|
|
c1c26e |
Message-id: <20190320114559.23708-1-otubo@redhat.com>
|
|
|
c1c26e |
Patchwork-id: 84937
|
|
|
c1c26e |
O-Subject: [RHEL-7.7 cloud-init PATCH] include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
|
c1c26e |
Bugzilla: 1653131
|
|
|
c1c26e |
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
|
c1c26e |
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
|
|
|
c1c26e |
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
|
c1c26e |
|
|
|
c1c26e |
The option NOZEROCONF=yes is not included by default in
|
|
|
c1c26e |
/etc/sysconfig/network, which is required by Overcloud instances. The
|
|
|
c1c26e |
patch also includes tests for the modifications.
|
|
|
c1c26e |
|
|
|
c1c26e |
X-downstream-only: yes
|
|
|
c1c26e |
Resolves: rhbz#1653131
|
|
|
c1c26e |
|
|
|
c1c26e |
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
|
|
|
c1c26e |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
c1c26e |
---
|
|
|
c1c26e |
cloudinit/net/sysconfig.py | 11 ++++++++++-
|
|
|
c1c26e |
tests/unittests/test_net.py | 1 -
|
|
|
c1c26e |
2 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
c1c26e |
|
|
|
c1c26e |
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
|
|
|
16d12a |
index 8bd7e88..810b283 100644
|
|
|
c1c26e |
--- a/cloudinit/net/sysconfig.py
|
|
|
c1c26e |
+++ b/cloudinit/net/sysconfig.py
|
|
|
16d12a |
@@ -754,7 +754,16 @@ class Renderer(renderer.Renderer):
|
|
|
c1c26e |
# Distros configuring /etc/sysconfig/network as a file e.g. Centos
|
|
|
c1c26e |
if sysconfig_path.endswith('network'):
|
|
|
c1c26e |
util.ensure_dir(os.path.dirname(sysconfig_path))
|
|
|
c1c26e |
- netcfg = [_make_header(), 'NETWORKING=yes']
|
|
|
c1c26e |
+ netcfg = []
|
|
|
c1c26e |
+ for line in util.load_file(sysconfig_path, quiet=True).split('\n'):
|
|
|
c1c26e |
+ if 'cloud-init' in line:
|
|
|
c1c26e |
+ break
|
|
|
c1c26e |
+ if not line.startswith(('NETWORKING=',
|
|
|
c1c26e |
+ 'IPV6_AUTOCONF=',
|
|
|
c1c26e |
+ 'NETWORKING_IPV6=')):
|
|
|
c1c26e |
+ netcfg.append(line)
|
|
|
c1c26e |
+ # Now generate the cloud-init portion of sysconfig/network
|
|
|
c1c26e |
+ netcfg.extend([_make_header(), 'NETWORKING=yes'])
|
|
|
c1c26e |
if network_state.use_ipv6:
|
|
|
c1c26e |
netcfg.append('NETWORKING_IPV6=yes')
|
|
|
c1c26e |
netcfg.append('IPV6_AUTOCONF=no')
|
|
|
c1c26e |
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
|
|
|
16d12a |
index 1306a0f..a931a3e 100644
|
|
|
c1c26e |
--- a/tests/unittests/test_net.py
|
|
|
c1c26e |
+++ b/tests/unittests/test_net.py
|
|
|
16d12a |
@@ -1483,7 +1483,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
|
c1c26e |
BOOTPROTO=none
|
|
|
c1c26e |
DEVICE=bond0
|
|
|
c1c26e |
DHCPV6C=yes
|
|
|
c1c26e |
- IPV6_AUTOCONF=no
|
|
|
c1c26e |
IPV6INIT=yes
|
|
|
c1c26e |
MACADDR=aa:bb:cc:dd:ee:ff
|
|
|
c1c26e |
ONBOOT=yes
|
|
|
c1c26e |
--
|
|
|
16d12a |
1.8.3.1
|
|
|
c1c26e |
|