[PATCH] pykickstart: don't set bootProto if --noipv4
Josef Bacik
jbacik at fb.com
Fri Oct 16 21:20:06 UTC 2015
If we specify a ipv6 only network configuration we still get bootproto=dhcp set,
which during kickstart makes networkmanager try to do a ipv4 dhcp which takes a
while to timeout. We don't want bootproto=dhcp set when we specify --noipv4, so
make sure it gets zero'ed out when we see that command.
Signed-off-by: Josef Bacik <jbacik at fb.com>
---
pykickstart/commands/network.py | 9 +++++++++
tests/commands/network.py | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/pykickstart/commands/network.py b/pykickstart/commands/network.py
index 818be79..58992c3 100644
--- a/pykickstart/commands/network.py
+++ b/pykickstart/commands/network.py
@@ -399,6 +399,15 @@ class FC6_Network(FC4_Network):
default=False)
return op
+ def parse(self, args):
+ retval = FC4_Network.parse(self, args)
+
+ # If we specify noipv4 then we need to make sure bootproto is zero'ed
+ # out
+ if retval.noipv4:
+ retval.bootProto = ""
+ return retval
+
class F8_Network(FC6_Network):
removedKeywords = FC6_Network.removedKeywords
removedAttrs = FC6_Network.removedAttrs
diff --git a/tests/commands/network.py b/tests/commands/network.py
index dbad1f9..0645555 100644
--- a/tests/commands/network.py
+++ b/tests/commands/network.py
@@ -35,6 +35,16 @@ class F20_TestCase(CommandTest):
cmd = "network --device team0 --bootproto dhcp --teamslaves=p3p1,p3p2 --teamconfig=\"{\\\"runner\\\": {\\\"name\\\": \\\"roundrobin\\\"}}\" --activate"
self.assert_parse(cmd)
+ cmd = "network --noipv4 --activate --hostname=blah.test.com --ipv6=1:2:3:4:5:6:7:8 --device eth0 --nameserver=1:1:1:1::,2:2:2:2::"
+ nd = self.assert_parse(cmd)
+ self.assertEquals(nd.bootProto, "")
+ self.assertEquals(nd.hostname, "blah.test.com")
+ self.assertTrue(nd.noipv4)
+ self.assertEquals(nd.ipv6, "1:2:3:4:5:6:7:8")
+ self.assertIn("1:1:1:1::", nd.nameserver)
+ self.assertIn("2:2:2:2::", nd.nameserver)
+ self.assertEquals(nd.device, "eth0")
+
# --teamslaves
# --teamslaves="<DEV1>['<CONFIG1>'],<DEV2>['<CONFIG2>'],..."
# CONFIGX is json with " escaped to \"
--
2.1.0
More information about the Kickstart-list
mailing list