From: Ondrej Lichtner <olichtne(a)redhat.com>
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>
---
lnst/Slave/NmConfigDevice.py | 15 +++++++++++----
1 file 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"])
--
1.8.3.1
Show replies by date