[PATCH rhel7-branch] network: don't crash, just log for unrecognized bond options (#1039006)
Vratislav Podzimek
vpodzime at redhat.com
Fri Sep 5 07:47:17 UTC 2014
On Fri, 2014-09-05 at 09:41 +0200, Radek Vykydal wrote:
> On 09/01/2014 02:06 PM, Vratislav Podzimek wrote:
> > On Mon, 2014-09-01 at 11:21 +0200, Radek Vykydal wrote:
> >> @@ -716,7 +723,12 @@ def nm_add_connection(values):
> >>
> >> proxy = _get_proxy(object_path="/org/freedesktop/NetworkManager/Settings",
> >> interface_name="org.freedesktop.NetworkManager.Settings")
> >> - connection = proxy.AddConnection('(a{sa{sv}})', settings)
> >> + try:
> >> + connection = proxy.AddConnection('(a{sa{sv}})', settings)
> >> + except GLib.GError as e:
> >> + if "bond.options: invalid option" in e.message:
> >> + raise AddConnectionError(e)
> > Looking at these lines I feel like it should be something like
> > "BondOptionsError", maybe a subclass of AddConnectionError. I think in
> > future we will want to catch and log+ingore more edge cases, but for now
> > the block of code trying to add the connection looks weird with no
> > information about what could raise such exception.
> >
>
> You are very right, attaching modified version of the patch.
ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list