[PATCH master] network: do not crash when device for network --device is not found (#1023829)

Vratislav Podzimek vpodzime at redhat.com
Mon Nov 4 13:58:39 UTC 2013


On Mon, 2013-11-04 at 14:19 +0100, Radek Vykydal wrote:
> Resolves: rhbz#1023829
> ---
>  pyanaconda/network.py | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index 2026ce2..0cb9dcb 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -1082,7 +1082,7 @@ def setOnboot(ksdata):
>          else:
>              devname = get_device_name(network_data.device)
>              if not devname:
> -                log.warning("Kickstart: The provided network interface %s does not exist" % network_data.device)
> +                log.warning("network: set ONBOOT: --device %s does not exist" % network_data.device)
>                  continue
>  
>          updated_devices.append(devname)
> @@ -1103,8 +1103,11 @@ def apply_kickstart_from_pre_section(ksdata):
>  
>          # get device name for device specified by MAC, link, bootif, etc...
>          dev_name = ks_spec_to_device_name(network_data.device)
> -        if not dev_name:
> -            log.error("Kickstart: The provided network interface %s does not exist" % network_data.device)
> +        if (not dev_name
> +            or (dev_name not in nm.nm_devices()
> +                and not network_data.vlanid
> +                and not network_data.bondslaves)):
> +            log.error("network: pre kickstart: --device %s does not exist" % network_data.device)
>              continue
>  
>          if network_data.vlanid:
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list