commit 4b3447736ec58f00a75bc60cbb08c38a871ce363
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Tue Jul 23 11:12:09 2013 +0200
NmConfigDevice: fix no bond options bug
When there are no bond options specified in the recipe file, lnst
created an empty dbus.Dictionary which is not accepted by NM.
This commit fixes that.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NmConfigDevice.py | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 88c2817..e7d6418 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -290,7 +290,10 @@ class NmConfigDeviceBond(NmConfigDeviceGeneric):
'''
value = self._config[int(value)]["name"]
options[option] = value
- return dbus.Dictionary(options, signature="ss")
+ if options:
+ return dbus.Dictionary(options, signature="ss")
+ else:
+ return None
def _add_bond(self):
netdev = self._netdev
@@ -304,9 +307,13 @@ class NmConfigDeviceBond(NmConfigDeviceGeneric):
options = self._setup_options()
- s_bond = dbus.Dictionary({
- 'interface-name': netdev["name"],
- 'options': options})
+ if options:
+ s_bond = dbus.Dictionary({
+ 'interface-name': netdev["name"],
+ 'options': options})
+ else:
+ s_bond = dbus.Dictionary({
+ 'interface-name': netdev["name"]})
s_ipv4, s_ipv6 = self._nm_make_ip_settings(netdev["addresses"])
Show replies by date