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

Martin Kolman mkolman at redhat.com
Tue Mar 4 10:57:34 UTC 2014


On Tue, 2014-03-04 at 10:44 +0100, Radek Vykydal wrote:
> 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.
Ok, that sounds like a lot nicer solution, thanks! :)
Doing a v2.
> 
> Radek
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches




More information about the anaconda-patches mailing list