[PATCH rhel6-branch] network: fix --bondopts used in kickstart %pre section (#1038001)

Radek Vykydal rvykydal at redhat.com
Fri May 9 12:39:24 UTC 2014


On 05/09/2014 04:51 AM, Brian C. Lane wrote:
> On Wed, May 07, 2014 at 10:45:16AM +0200, Radek Vykydal wrote:
>> Resolves: rhbz#1038001
>> ---
>>   kickstart.py | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/kickstart.py b/kickstart.py
>> index 3091299..78f5b6e 100644
>> --- a/kickstart.py
>> +++ b/kickstart.py
>> @@ -693,7 +693,8 @@ class NetworkData(commands.network.RHEL6_NetworkData):
>>                       return
>>                   activate_new_device = True
>>                   dev = anaconda.id.network.enableBondingDevice(device)
>> -                dev.set(("BONDING_OPTS", self.bondopts))
>> +                bondopts = " ".join(self.bondopts.split(";" if ';' in self.bondopts else ","))
> Splitting then rejoining seems awkward. How about:
>
> bondopts = re.sub("[,;]", " ", self.bondopts)
>

I should have noticed that (syntax taken over from dracut) the options
are separated by comma, but if any option contains comma they are
separated by semicolon - in this case we don't want to replace commas by 
spaces.
For example:
--bondopts=o1=v1;o2=v2,v3

(There is one corner case that I don't catch: "--bondopts=o1=v1,v2"
where comma would be incorrectly replaced by space. I've actually never
met a use case with an option containing comma, moreover I suppose that
such an option would hardly come alone - at least "mode=" option will
be probably always there, so I decided not to care here.)






More information about the anaconda-patches mailing list