]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Execute udevadm on other linux installs
authorCarol Bouchard <caboucha@cisco.com>
Fri, 10 Oct 2014 21:06:04 +0000 (17:06 -0400)
committerCarol Bouchard <caboucha@cisco.com>
Fri, 10 Oct 2014 21:06:04 +0000 (17:06 -0400)
When ofa and ovs neutron agents start, they use the linux utility
'udevadm'.  It is passed as an argument with an absolute directory path
which can vary on each linux install.  By removing the directory path,
it will find this utility by way of the user's environment path since
linux executables are configured in each user's path upon user creation.

Change-Id: I2344290d38c7889b8f32d8fb9c5161b09826e037
Closes-bug:  #1367697

neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/ofagent/test_ofa_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_tunnel.py

index 8c4b98a3e3132c3cf40f14fff93f01861c3bf0ba..b3c9d254a008c61ee7401b09bfed705c5895636d 100644 (file)
@@ -604,7 +604,7 @@ class OFANeutronAgent(n_rpc.RpcCallback,
             # Give udev a chance to process its rules here, to avoid
             # race conditions between commands launched by udev rules
             # and the subsequent call to ip_wrapper.add_veth
-            utils.execute(['/sbin/udevadm', 'settle', '--timeout=10'])
+            utils.execute(['udevadm', 'settle', '--timeout=10'])
 
     def _phys_br_create_veth(self, br, int_veth_name,
                              phys_veth_name, physical_network, ip_wrapper):
index 8901cdeb9b233ee917779df4e33f600615cf5875..18a3e54bb9e3e8018549f7b618e896a8058c31a7 100644 (file)
@@ -895,7 +895,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback,
                     # Give udev a chance to process its rules here, to avoid
                     # race conditions between commands launched by udev rules
                     # and the subsequent call to ip_wrapper.add_veth
-                    utils.execute(['/sbin/udevadm', 'settle', '--timeout=10'])
+                    utils.execute(['udevadm', 'settle', '--timeout=10'])
                 int_veth, phys_veth = ip_wrapper.add_veth(int_if_name,
                                                           phys_if_name)
                 int_ofport = self.int_br.add_port(int_veth)
index 638b40120ed8e798c2c45f6778b49ebfed6845a9..1a6b8af972af5203e1fbed461d26d1b48e06c77e 100644 (file)
@@ -482,7 +482,7 @@ class TestOFANeutronAgent(ofa_test_base.OFAAgentTestBase):
             br_addport_fn.return_value = "11"
             self.agent.setup_physical_bridges({"physnet1": "br-eth"})
             expected_calls = [mock.call.link_delete(),
-                              mock.call.utils_execute(['/sbin/udevadm',
+                              mock.call.utils_execute(['udevadm',
                                                        'settle',
                                                        '--timeout=10']),
                               mock.call.add_veth('int-br-eth',
index 64ba72a9058e54160f91375db76279964584047d..65a612e23731a75fa1b291769b0223c1b4870e54 100644 (file)
@@ -918,7 +918,7 @@ class TestOvsNeutronAgent(base.BaseTestCase):
             get_br_fn.return_value = ["br-eth"]
             self.agent.setup_physical_bridges({"physnet1": "br-eth"})
             expected_calls = [mock.call.link_delete(),
-                              mock.call.utils_execute(['/sbin/udevadm',
+                              mock.call.utils_execute(['udevadm',
                                                        'settle',
                                                        '--timeout=10']),
                               mock.call.add_veth('int-br-eth',
index 8da894ee0f4388673b0f1a05cda98b6a7fbe47a0..ca36450583efbc890f6f52b106b1fe7b34534218 100644 (file)
@@ -670,7 +670,7 @@ class TunnelTestUseVethInterco(TunnelTest):
 
         self.inta_expected = [mock.call.link.set_up()]
         self.intb_expected = [mock.call.link.set_up()]
-        self.execute_expected = [mock.call(['/sbin/udevadm', 'settle',
+        self.execute_expected = [mock.call(['udevadm', 'settle',
                                             '--timeout=10'])]