← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1348703] [NEW] LinuxInterfaceDriver plug and unplug methods in derived class already check for device existence

 

Public bug reported:

LinuxInterfaceDriver plug and unplug in derived classes already check if
the device exists. There's no need to duplicate the check in the code
that is calling those methods. See l3_agent.py in internal_network_added
for example:

        if not ip_lib.device_exists(interface_name,
                                    root_helper=self.root_helper,
                                    namespace=ri.ns_name):
            self.driver.plug(network_id, port_id, interface_name, mac_address,
                             namespace=ri.ns_name,
                             prefix=INTERNAL_DEV_PREFIX)

the check "if not ip_lib.device_exists" is a duplicate and it's
expensive.

** Affects: neutron
     Importance: Undecided
         Status: Confirmed


** Tags: low-hanging-fruit

** Changed in: neutron
       Status: New => Confirmed

** Tags added: low-hanging-fruit

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1348703

Title:
  LinuxInterfaceDriver plug and unplug methods in derived class already
  check for device existence

Status in OpenStack Neutron (virtual network service):
  Confirmed

Bug description:
  LinuxInterfaceDriver plug and unplug in derived classes already check
  if the device exists. There's no need to duplicate the check in the
  code that is calling those methods. See l3_agent.py in
  internal_network_added for example:

          if not ip_lib.device_exists(interface_name,
                                      root_helper=self.root_helper,
                                      namespace=ri.ns_name):
              self.driver.plug(network_id, port_id, interface_name, mac_address,
                               namespace=ri.ns_name,
                               prefix=INTERNAL_DEV_PREFIX)

  the check "if not ip_lib.device_exists" is a duplicate and it's
  expensive.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1348703/+subscriptions


Follow ups

References