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

Vratislav Podzimek vpodzime at redhat.com
Mon Mar 3 19:18:45 UTC 2014


On Mon, 2014-03-03 at 19:20 +0100, 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.
Looks good to me.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list