[PATCH rhel7-branch] network: don't crash, just log for unrecognized bond options (#1039006)

Radek Vykydal rvykydal at redhat.com
Fri Sep 5 07:41:45 UTC 2014


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-network-don-t-crash-just-log-for-unrecognized-bond-o.patch
Type: text/x-patch
Size: 2132 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20140905/33674821/attachment.bin>


More information about the anaconda-patches mailing list