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

Brian C. Lane bcl at redhat.com
Fri May 9 15:05:42 UTC 2014


On Fri, May 09, 2014 at 02:39:24PM +0200, Radek Vykydal wrote:
> 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

Ah, ok, not much you can do to simplify it then. Thanks for the
explanation, it would probably be good to add an example to the commit
or as a comment.

Ack.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list