[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [lnst] Fix empty team port bug
From:       Jiří Pírko <jirka () fedoraproject ! org>
Date:       2014-01-25 12:13:51
Message-ID: 20140125121351.356DF616C0 () fedorahosted ! org
[Download RAW message or body]

commit 1174ba74009d4ead271d8cde51dd4f708fe2d643
Author: Jan Tluka <jtluka@redhat.com>
Date:   Tue Jan 14 11:05:08 2014 +0100

    Fix empty team port bug
    
    Team daemon refuses to update port configuration with empty string. This
    patch fixes this issue and passes the config only if it has been
    specified in the recipe.
    
    Signed-off-by: Jan Tluka <jtluka@redhat.com>
    Signed-off-by: Jiri Pirko <jiri@resnulli.us>

 lnst/Slave/NmConfigDevice.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index bf488cb..396dea8 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -750,8 +750,6 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
 
             teamd_port_config = get_slave_option(self._netdev,
                                                  slave, "teamd_port_config")
-            if teamd_port_config == None:
-                teamd_port_config = ""
 
             s_eth = dbus.Dictionary({
                 'duplex': dbus.Array('full', 's'),
@@ -765,13 +763,14 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
                 'master': self._netdev["master_uuid"],
                 'slave-type': 'team'})
 
-            s_port_cfg = dbus.Dictionary({
-                'config': teamd_port_config})
-
             slave_con = dbus.Dictionary({
                 '802-3-ethernet': s_eth,
-                'connection': s_slave_con,
-                'team-port': s_port_cfg})
+                'connection': s_slave_con})
+
+            if teamd_port_config != None:
+                s_port_cfg = dbus.Dictionary({
+                    'config': teamd_port_config})
+                slave_con['team-port'] = s_port_cfg
 
             netdev["con_obj_path"] = self._nm_add_connection(slave_con)
 
_______________________________________________
LNST-developers mailing list
LNST-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic