summaryrefslogtreecommitdiff
path: root/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-23 09:47:31 -0800
committerBen Pfaff <blp@nicira.com>2010-02-23 09:52:13 -0800
commit96c7918c4043326bfa0e05b3fc9cbb9547279d40 (patch)
tree07f851e717c09d7164a38b23436bf4dc202c7779 /xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py
parent6987c81c05f21c579fbe60e9b6693862abbbb762 (diff)
downloadopenvswitch-96c7918c4043326bfa0e05b3fc9cbb9547279d40.tar.gz
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 <ian.campbell@citrix.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py')
-rw-r--r--xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py
index 0fa9322d4..783fad301 100644
--- a/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py
+++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py
@@ -136,34 +136,6 @@ def destroy_bond_device(pif):
__destroy_bond_device(name)
#
-# Bridges
-#
-
-def pif_is_bridged(pif):
- pifrec = db().get_pif_record(pif)
- nwrec = db().get_network_record(pifrec['network'])
-
- if nwrec['bridge']:
- # TODO: sanity check that nwrec['bridgeless'] != 'true'
- return True
- else:
- # TODO: sanity check that nwrec['bridgeless'] == 'true'
- return False
-
-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)
-
-#
# Bring Interface up/down.
#