From 96c7918c4043326bfa0e05b3fc9cbb9547279d40 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Feb 2010 09:47:31 -0800 Subject: xenserver: Hoist identical bridge and vswitch functions into common code. The previous commit made pif_bridge_name() in the bridge and vswitch versions of interface-reconfigure functionally identical, so this commit hoists them into a single common implementation in InterfaceReconfigure.py. pif_is_bridged() also comes along for the ride because it is also generic and because it is logically related. Only the bridge code uses it at the moment. Suggested-by: Ian Campbell Signed-off-by: Ben Pfaff --- .../opt_xensource_libexec_InterfaceReconfigureVswitch.py | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py') diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index f777b1787..41acf58b0 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -36,22 +36,6 @@ def netdev_up(netdev, mtu=None): run_command(["/sbin/ifconfig", netdev, 'up'] + mtu) -# -# Bridges -# - -def pif_bridge_name(pif): - """Return the bridge name of a pif. - - PIF must be a bridged PIF.""" - - pifrec = db().get_pif_record(pif) - nwrec = db().get_network_record(pifrec['network']) - if nwrec['bridge']: - return nwrec['bridge'] - else: - raise Error("PIF %(uuid)s does not have a bridge name" % pifrec) - # # PIF miscellanea # -- cgit v1.2.1