From: Ian Campbell Date: Thu, 6 Aug 2009 20:39:24 +0000 (-0700) Subject: xenserver: Cope gracefully with non-integer MTU in interface-reconfigure. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c239b2d4f3535012bea0261ff81fc570771b6f9b;p=openvswitch xenserver: Cope gracefully with non-integer MTU in interface-reconfigure. CP-1148. --- diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index 72d43860..5f19ff36 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -758,12 +758,13 @@ def configure_netdev(pif): else: raise Error("Unknown IP-configuration-mode %s" % pifrec['ip_configuration_mode']) - oc = {} - if pifrec.has_key('other_config'): - oc = pifrec['other_config'] - if oc.has_key('mtu'): + oc = pifrec['other_config'] + if oc.has_key('mtu'): + try: int(oc['mtu']) # Check that the value is an integer ifconfig_argv += ['mtu', oc['mtu']] + except ValueError, x: + log("Invalid value for mtu = %s" % mtu) run_command(ifconfig_argv)