]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Set type=internal as part of port creation
authorTerry Wilson <twilson@redhat.com>
Fri, 26 Dec 2014 20:06:20 +0000 (13:06 -0700)
committerTerry Wilson <twilson@redhat.com>
Fri, 26 Dec 2014 20:06:20 +0000 (13:06 -0700)
When creating an internal device with ovs-vsctl, the 'set'
operation must occur as part of the transaction that creates the
port, otherwise the device creation will fail and an ofport will
not be assigned.

Change-Id: I30ecb920ee1c64d25b5e7eed69e92bd71caac435

neutron/tests/functional/agent/linux/base.py

index b900d56fd65a8d41bc12e0242c0e1a308e208601..cdf8a2eaecad999ac9944c2a581aa7dd19deaaa9 100644 (file)
@@ -117,9 +117,8 @@ class BaseOVSLinuxTestCase(BaseLinuxTestCase):
 
     def create_ovs_port_in_ns(self, br, ns):
         def create_port(name):
-            br.add_port(name)
+            br.replace_port(name, ('type', 'internal'))
             self.addCleanup(br.delete_port, name)
-            br.set_db_attribute('Interface', name, 'type', 'internal')
             return name
         port_name = self.create_resource(PORT_PREFIX, create_port)
         port_dev = self.ip.device(port_name)