[PATCH rhel7-branch] network: add s390 network ifcfg options also for bond slaves (#1090558)
Vratislav Podzimek
vpodzime at redhat.com
Mon Sep 8 12:24:08 UTC 2014
On Mon, 2014-09-08 at 12:10 +0200, Radek Vykydal wrote:
> Resolves: rhbz#1090558
> ---
> dracut/parse-kickstart | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
> index a8ece63..1e46b35 100755
> --- a/dracut/parse-kickstart
> +++ b/dracut/parse-kickstart
> @@ -313,6 +313,16 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
>
> return " ".join(line)
>
> +def add_s390_settings(dev, ifcfg):
> + s390cfg = s390_settings(dev)
> + if s390cfg['SUBCHANNELS']:
> + ifcfg.pop('HWADDR')
> + ifcfg['SUBCHANNELS'] = s390cfg['SUBCHANNELS']
> + if s390cfg['NETTYPE']:
> + ifcfg['NETTYPE'] = s390cfg['NETTYPE']
> + if s390cfg['OPTIONS']:
> + ifcfg['OPTIONS'] = s390cfg['OPTIONS']
> +
> def ksnet_to_ifcfg(net, filename=None):
> '''Write an ifcfg file for the given kickstart network config'''
> dev = net.device
> @@ -336,14 +346,7 @@ def ksnet_to_ifcfg(net, filename=None):
> # we use it to activate devcies by NM on start
> ifcfg['ONBOOT'] = "yes" if net.activate else "no"
>
> - s390cfg = s390_settings(dev)
> - if s390cfg['SUBCHANNELS']:
> - ifcfg.pop('HWADDR')
> - ifcfg['SUBCHANNELS'] = s390cfg['SUBCHANNELS']
> - if s390cfg['NETTYPE']:
> - ifcfg['NETTYPE'] = s390cfg['NETTYPE']
> - if s390cfg['OPTIONS']:
> - ifcfg['OPTIONS'] = s390cfg['OPTIONS']
> + add_s390_settings(dev, ifcfg)
>
> # dhcp etc.
> ifcfg['BOOTPROTO'] = net.bootProto
> @@ -412,6 +415,7 @@ def ksnet_to_ifcfg(net, filename=None):
> 'MASTER' : dev,
> 'HWADDR' : readsysfile("/sys/class/net/%s/address" % slave),
> }
> + add_s390_settings(slave, slave_ifcfg)
> slave_filename = "/tmp/ifcfg/ifcfg-%s" % "_".join(slave_ifcfg['NAME'].split(" "))
> log.info("writing ifcfg %s for slave %s of bond %s" % (slave_filename, slave, dev))
> write_ifcfg(slave_filename, slave_ifcfg)
Makes sense. ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list