Only write Network.PIF elements for this host to dbcache.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 9 Sep 2009 17:09:02 +0000 (18:09 +0100)
committerBen Pfaff <blp@nicira.com>
Wed, 9 Sep 2009 17:41:45 +0000 (10:41 -0700)
xenserver/opt_xensource_libexec_interface-reconfigure

index fdb91abe5595172f1d27cc3e30e7a2a0e416de0c..e77e85b1d5cd236125fb2ae009d216f022b6d352 100755 (executable)
@@ -456,7 +456,11 @@ class DatabaseCache(object):
             rec = session.xenapi.network.get_record(n)
             self.__networks[n] = {}
             for f in NETWORK_ATTRS:
-                self.__networks[n][f] = rec[f]
+                if f == "PIFs":
+                    # drop PIFs on other hosts
+                    self.__networks[n][f] = [p for p in rec[f] if self.__pif_on_host(p)]
+                else:
+                    self.__networks[n][f] = rec[f]
             self.__networks[n]['other_config'] = {}
             for f in NETWORK_OTHERCONFIG_ATTRS:
                 if not rec['other_config'].has_key(f): continue