return neutron_bridge_list
def get_interfaces_on_bridge(self, bridge_name):
- if ip_lib.device_exists(bridge_name, root_helper=self.root_helper):
+ if ip_lib.device_exists(bridge_name):
bridge_interface_path = BRIDGE_INTERFACES_FS.replace(
BRIDGE_NAME_PLACEHOLDER, bridge_name)
return os.listdir(bridge_interface_path)
def ensure_vlan(self, physical_interface, vlan_id):
"""Create a vlan unless it already exists."""
interface = self.get_subinterface_name(physical_interface, vlan_id)
- if not ip_lib.device_exists(interface, root_helper=self.root_helper):
+ if not ip_lib.device_exists(interface):
LOG.debug(_("Creating subinterface %(interface)s for "
"VLAN %(vlan_id)s on interface "
"%(physical_interface)s"),
def ensure_vxlan(self, segmentation_id):
"""Create a vxlan unless it already exists."""
interface = self.get_vxlan_device_name(segmentation_id)
- if not ip_lib.device_exists(interface, root_helper=self.root_helper):
+ if not ip_lib.device_exists(interface):
LOG.debug(_("Creating vxlan interface %(interface)s for "
"VNI %(segmentation_id)s"),
{'interface': interface,
If a VIF has been plugged into a network, this function will
add the corresponding tap device to the relevant bridge.
"""
- if not ip_lib.device_exists(tap_device_name,
- root_helper=self.root_helper):
+ if not ip_lib.device_exists(tap_device_name):
LOG.debug(_("Tap device: %s does not exist on "
"this host, skipped"), tap_device_name)
return False
tap_device_name)
def delete_vlan_bridge(self, bridge_name):
- if ip_lib.device_exists(bridge_name, root_helper=self.root_helper):
+ if ip_lib.device_exists(bridge_name):
interfaces_on_bridge = self.get_interfaces_on_bridge(bridge_name)
for interface in interfaces_on_bridge:
self.remove_interface(bridge_name, interface)
del self.network_map[network_id]
def remove_interface(self, bridge_name, interface_name):
- if ip_lib.device_exists(bridge_name, root_helper=self.root_helper):
+ if ip_lib.device_exists(bridge_name):
if not self.is_device_on_bridge(interface_name):
return True
LOG.debug(_("Removing device %(interface_name)s from bridge "
return False
def delete_vlan(self, interface):
- if ip_lib.device_exists(interface, root_helper=self.root_helper):
+ if ip_lib.device_exists(interface):
LOG.debug(_("Deleting subinterface %s for vlan"), interface)
if utils.execute(['ip', 'link', 'set', interface, 'down'],
root_helper=self.root_helper):
LOG.debug(_("Done deleting subinterface %s"), interface)
def delete_vxlan(self, interface):
- if ip_lib.device_exists(interface, root_helper=self.root_helper):
+ if ip_lib.device_exists(interface):
LOG.debug(_("Deleting vxlan interface %s for vlan"),
interface)
int_vxlan = self.ip.device(interface)
return False
for segmentation_id in range(1, constants.MAX_VXLAN_VNI + 1):
if not ip_lib.device_exists(
- self.get_vxlan_device_name(segmentation_id),
- root_helper=self.root_helper):
+ self.get_vxlan_device_name(segmentation_id)):
break
else:
LOG.error(_('No valid Segmentation ID to perform UCAST test.'))