[PATCH] pykickstart: don't set bootProto if --noipv4

Josef Bacik jbacik at fb.com
Mon Oct 19 19:11:18 UTC 2015


On 10/19/2015 02:02 PM, Chris Lumens wrote:
>> 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 \"
>
> Annoying as it is, I think this fix belongs in an F24 version of the
> network command.  It's possible changing this all the way back to FC6
> will break some user of pykickstart that's relying on it.
>

Fair enough, I'll redo it.  Thanks,

Josef




More information about the Kickstart-list mailing list