[PATCH] Don't traceback, just log a warning if connection is unavailable (#1070928)

Radek Vykydal rvykydal at redhat.com
Tue Mar 4 09:44:53 UTC 2014


On 03/03/2014 07:20 PM, Martin Kolman wrote:
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>   pyanaconda/nm.py | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py
> index 3bfbaa9..855ee01 100644
> --- a/pyanaconda/nm.py
> +++ b/pyanaconda/nm.py
> @@ -28,6 +28,9 @@ import re
>   
>   from pyanaconda.constants import DEFAULT_DBUS_TIMEOUT
>   
> +import logging
> +log = logging.getLogger("anaconda")
> +
>   supported_device_types = [
>       NetworkManager.DeviceType.ETHERNET,
>       NetworkManager.DeviceType.WIFI,
> @@ -685,8 +688,10 @@ def nm_activate_device_connection(dev_name, con_uuid):
>           if "org.freedesktop.NetworkManager.UnmanagedDevice" in e.message:
>               raise UnmanagedDeviceError(dev_name, e)
>           elif "org.freedesktop.NetworkManager.UnknownConnection" in e.message:
> -            raise UnknownConnectionError(dev_name, e)
> -        raise
> +            log.warning("can't activate connection %s for device %s: connection not available on the device" %
> +                       (con_uuid, dev_name))
> +        else:
> +            raise
>   
>   def nm_add_connection(values):
>       """Add new connection specified by values.

We are already catching UnknownConnectionError when calling 
nm_activate_device_connection
in network spokes so we should keep raising it, and for the BZ issue the 
UnknownConnectionError
should be caughtin apply_kickstart_from_pre_section and logged there too.

Radek



More information about the anaconda-patches mailing list