Change in vdsm[master]: net: clean CachingNetInfo API.

ibarkan at redhat.com ibarkan at redhat.com
Mon Dec 7 13:14:28 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: net: clean CachingNetInfo API.
......................................................................

net: clean CachingNetInfo API.

The object should have a clean API regarding its cache changes.

Change-Id: I2a956da7adb4b1578e87faeb9bff1a19b941102d
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M lib/vdsm/netinfo/__init__.py
M lib/vdsm/network/api.py
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/49999/1

diff --git a/lib/vdsm/netinfo/__init__.py b/lib/vdsm/netinfo/__init__.py
index 765cada..97686fb 100644
--- a/lib/vdsm/netinfo/__init__.py
+++ b/lib/vdsm/netinfo/__init__.py
@@ -238,6 +238,12 @@
         self.bondings = _netinfo['bondings']
         self.bridges = _netinfo['bridges']
 
+    def del_network(self, network):
+        del self.networks[network]
+
+    def del_bonding(self, bonding):
+        del self.bondings[bonding]
+
     def getNetworksAndVlansForIface(self, iface):
         """ Returns tuples of (bridge/network, vlan) connected to  nic/bond """
         return chain(self._getBridgedNetworksAndVlansForIface(iface),
diff --git a/lib/vdsm/network/api.py b/lib/vdsm/network/api.py
index c3ed8b8..4ba04c3 100755
--- a/lib/vdsm/network/api.py
+++ b/lib/vdsm/network/api.py
@@ -674,7 +674,7 @@
                                     _netinfo=_netinfo,
                                     destroyOnMasterRemoval='remove' in attrs)
             bond.remove()
-            del _netinfo.bondings[name]
+            _netinfo.del_bonding(name)
         elif name in _netinfo.bondings:
             edition.append((name, attrs))
         else:
@@ -924,7 +924,7 @@
                 _delNetwork(network, configurator=configurator,
                             implicitBonding=False, _netinfo=_netinfo,
                             keep_bridge=keep_bridge)
-                del _netinfo.networks[network]
+                _netinfo.del_network(network)
                 _netinfo.updateDevices()
             elif network in libvirt_nets:
                 # If the network was not in _netinfo but is in the networks


-- 
To view, visit https://gerrit.ovirt.org/49999
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a956da7adb4b1578e87faeb9bff1a19b941102d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list