xenserver: Avoid error due to missing MTU fields on XenServer 5.5.
authorBen Pfaff <blp@nicira.com>
Wed, 24 Feb 2010 23:45:11 +0000 (15:45 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Feb 2010 23:45:11 +0000 (15:45 -0800)
The network records in XenServer 5.5 do not have an MTU field, so allow
these to be missing.

Diagnosed-by: Reid Price <reid@nicira.com>
CC: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
xenserver/opt_xensource_libexec_InterfaceReconfigure.py

index 3c3a0195a6687fe8977f0094451fcb019a5489f7..570ebccbe73cb454c53b627244d0034060a97f83 100644 (file)
@@ -402,6 +402,10 @@ class DatabaseCache(object):
                 if f == "PIFs":
                     # drop PIFs on other hosts
                     self.__networks[n][f] = [p for p in rec[f] if self.__pif_on_host(p)]
+                elif f == "MTU" and f not in rec:
+                    # XenServer 5.5 network records did not have an
+                    # MTU field, so allow this to be missing.
+                    pass
                 else:
                     self.__networks[n][f] = rec[f]
             self.__networks[n]['other_config'] = {}