netdev: do not allow devices to be opened with conflicting types
[cascardo/ovs.git] / xenserver / opt_xensource_libexec_InterfaceReconfigure.py
index 2630077..74b784d 100644 (file)
@@ -44,7 +44,8 @@ def log(s):
     if get_log_destination() == 'syslog':
         syslog.syslog(s)
     else:
-        print >>sys.stderr, s
+        sys.stderr.write(s + '\n')
+        sys.stderr.flush()
 
 #
 # Exceptions.
@@ -730,7 +731,7 @@ def mtu_setting(nw, type, oc):
         try:
             int(mtu)      # Check that the value is an integer
             return mtu
-        except ValueError, x:
+        except ValueError as x:
             log("Invalid value for mtu = %s" % mtu)
 
     return None
@@ -958,7 +959,7 @@ def DatapathFactory():
         network_conf = open(root_prefix() + "/etc/xensource/network.conf", 'r')
         network_backend = network_conf.readline().strip()
         network_conf.close()                
-    except Exception, e:
+    except Exception as e:
         raise Error("failed to determine network backend:" + e)
     
     if network_backend == "bridge":