xenserver: Remove bridge configuration files when they become stale.
authorBen Pfaff <blp@nicira.com>
Thu, 21 May 2009 20:25:40 +0000 (13:25 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 21 May 2009 20:25:40 +0000 (13:25 -0700)
interface-reconfigure communicates with the vif script using files in
/etc/openvswitch, but it didn't delete them when they were stale.  This
commit fixes the problem.

xenserver/opt_xensource_libexec_interface-reconfigure

index 3b99820ffaa454baff1e534905b6a59a116decc5..3de1099d30a1e32f246969b41bdc87fa775dd527 100755 (executable)
@@ -842,6 +842,11 @@ def action_up(pif):
         f.close()
         f.apply()
         f.commit()
+    else:
+        try:
+            os.unlink("%s/br-%s" % (vswitch_config_dir, bridge))
+        except OSError:
+            pass
     if bond_master:
         argv += configure_bond(bond_master)
     modify_config(argv)