daemon: Remove short options from daemon library
[openvswitch] / xenserver / opt_xensource_libexec_interface-reconfigure
index 481bddd2eab7c0b30e601503d27e85fdbe9ee096..5f19ff3684463927fca57bb10d2e570b39a35be8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (c) Citrix Systems 2008. All rights reserved.
+# Copyright (c) 2008,2009 Citrix Systems, Inc. All rights reserved.
 # Copyright (c) 2009 Nicira Networks.
 #
 """Usage:
@@ -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)