Commit Graph

19 Commits

Author SHA1 Message Date
Sahid Orentino Ferdjaoui 1d8e3b79db dhcp: make device manager to clean only not used devices
This change makes device manager action to clean device a bit smarter
by comparing port registered for a given network with device in live.

Partial-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: I0b6f9b59b94cf05996e4217b5d232b69ad775502
2022-10-11 08:56:50 +02:00
yatinkarel 820b2e2665 Ensure gateway is set for prefix delegated subnets
With [1] gateway is no longer set for subnet created
with prefix delegation, but when adding the subnet
to the router it fails as it expects gateway to be
set.

This patch ensures gateway is set temporary to the first IP
of the subnet as it used to be just like the temporary CIDR.
Also need to ensure dhcp configuration is skipped to avoid the
original issue[2].

[1] https://review.opendev.org/c/openstack/neutron/+/699465
[2] https://bugs.launchpad.net/neutron/+bug/1856675

Closes-Bug: #1962306
Related-Bug: #1856675
Change-Id: I512f7d98ac99bb0ef06fd2acba09482e3436d18d
2022-03-03 11:10:54 +05:30
Rodolfo Alonso Hernandez c686a2b555 Improve DHCP RPC handler
Remove unnecessary DB retrieval operations from "get_network_info"
method.

Partial-Bug: #1950662
Change-Id: If4b33c8437dba411fed913e7e1c7f06d899c08f7
2021-11-29 08:43:51 +00:00
Brian Haley 8126f88894 Complete removal of dependency on the "mock" package
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

This completes removal of all references to "import mock",
changing to "from unittest import mock" in fullstack and
functional tests.

Added a hacking check to enforce it in future patches.

Change-Id: Ifcaf1c21bea0ec3c35278e49cecc90a101a82113
2020-05-01 12:05:34 -04:00
Rodolfo Alonso Hernandez 33fb446add Deprecate config option "ovs_integration_bridge"
Remove this duplicated option and rely only in OVS.integration_bridge.

NOTE: other projects are still using it; first we need to deprecate it
      in those projects.

Change-Id: I4e826c8b9fa764b1820adacc3427934dc393c0bc
Related-Bug: #1856152
2020-02-17 11:02:16 +00:00
Hongbin Lu 46913a69fd Use constant IP_VERSION_4/6 in functional tests
Change-Id: I62b5a37508838a42b03a39de02660b8cafc08c41
2018-08-27 21:45:56 +00:00
sindhu devale 51ca683797 Refactoring agent linux&ovsdb config
Refactoring neutron agent linux and ovsdb config opts
to be in neutron/conf/agent so that all the config options
reside in a centralized location. This simplifies the
process of looking up the config opts and provides an easy
way to import.

NeutronLibImpact

Change-Id: Ib1e0e63dec2985c417412d1ecc68e2a74ef87182
Partial-Bug: #1563069
2017-08-25 10:41:39 -04:00
YAMAMOTO Takashi 26920b8712 test_dhcp: Use a safer host name
We use "foo_host" as a hostname in a test.
Usually "_" is not allowed in a hostname. (See RFC 952 etc)
Oslo.config (correctly) complains on that.

Closes-Bug: #1689019
Change-Id: Ife817d4f9f904ab1cecb1d8501b94069d5468bdf
2017-05-08 14:01:43 +09:00
Ihar Hrachyshka 1ae91ce9be ip_lib: ignore gre and lo devices in get_devices by default
This is the most common use pattern for the method, so it makes sense to
make it default.

(Actually, it may be that there are no usage for the arguments
whatsoever, but better safe than sorry.)

NeutronLibImpact this change potentially breaks callers of get_devices
that may want to get the automatic devices by default. Those imaginary
callers may need to set exclude_gre_devices and/or exclude_loopback to
True from now on.

Change-Id: Ic32b8abc7f8502b8907ae21c996e13cb8fd5401d
Related-Bug: #1604115
2017-04-13 15:03:06 -07:00
Ihar Hrachyshka 5c286f590f Ignore gre devices when fetching devices in test_cleanup_stale_devices
They may show up in namespaces depending on kernel modules loaded.

Change-Id: I78892244d17c4ab7421d3eae9bdeeec1e69690bc
Related-Bug: #1604115
2017-04-07 13:07:33 -07:00
Kevin Benton 63ff8f7fbe Assert contents of returned devices in test
Having this test fail with:

testtools.matchers._impl.MismatchError: 2 != 4

Doesn't really tell the developer what went wrong.
We can just compare the lists of devices directly so a mismatch
will show the devices that leaked in.

TrivialFix

Change-Id: Ic5a3b347bea7e5aa8a5caee5035568e5954f58dc
2017-04-06 21:53:03 +00:00
John Perkins 7f23ccce23 Agent common config
Refactoring Neutron configuration options for agent common config to be
in neutron/conf/agent/common. This will allow centralization of all
configuration options and provide an easy way to import.

Partial-Bug: #1563069
Change-Id: Iebac0cdd3bcfd0135349128921b7ad7a1a939ab8
Needed-By: Ib676003bbe909b5a9013a3178b12dbe291d936af
2017-03-15 09:52:18 -06:00
Anindita Das 414ceed4f3 Refactoring config options for common config opts
Refactoring neutron common config opts to be in neutron/conf/common so
that all the configuration options reside in a centralized location.
This simplifies the process of looking up the config opts and provides
an easy way to import.

Moved conf/common/config.py to conf/common.py as per review comments.

Partial-Bug: #1563069

Change-Id: Ib5fa294906549237630f87b9c848eebe0644088c
2016-07-26 15:55:49 +00:00
Kevin Benton 97c78ef0cc Fix wait_until_true condition in dhcp test
Need to actually check something that might change. :)

Change-Id: I76577da5683271515f487081063c00e4fc0d864d
2016-07-20 04:18:41 -07:00
Armando Migliaccio 5bbb802222 Ensure test_cleanup_stale_devices fails gracefully
Give some time for devices to be cleared before we claim defeat.

Change-Id: I34b2ec634f1c9ec27a1b82cc3f55a5e0b7d71237
Closes-bug: #1604115
2016-07-19 14:05:16 -07:00
Aradhana Singh 607957ef35 Refactoring config options for dhcp agent
Refactoring neutron configuration options for dhcp agent to be in
neutron/conf/agent. This would allow centralization of all configuration
options and provide an easy way to import.

Change-Id: Ia17d2d7223dd598e2d36a8320942fb03b61dffaf
Partial-Bug: #1563069
2016-07-06 17:24:23 +00:00
Bhagyashri Shewale 88e899f7a0 Fix module's import order
Made corrections in import order for built-in, third party and
project specific modules as per OpenStack import standards [1].

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I899deefd6ee4732d6c0afd17a5afbe42b0fa37ba
2016-01-22 06:38:42 -08:00
Cedric Brandily 23b907bc6e Remove deprecated use_namespaces option
The use_namespaces option has been defined as a workaround to kernels
not properly supporting namespaces. This limitation is behind us, it's
time to remove use_namespaces after its deprecation in Kilo in order to
simplify code and remove a poorly tested case (use_namespaces=False).

This change prepares for removal pullup_route method[1] which was only
used when use_namespaces=False.

[1] neutron.agent.linux.ip_lib

DocImpact
UpgradeImpact
Closes-Bug: #1508188
Related-Bug: #1435382
Depends-On: I303038eec560a6d99421140c2822aed8b518470b
Depends-On: I4feb2a15c7e1e4bfdbed2531b18b8e7d798ab3cc
Change-Id: I2fbf65df1250d9f9f1656b3964ee3b6de1ef1118
2015-11-18 19:17:29 +01:00
Eugene Nikanorov 6ac43c119b Cleanup dhcp namespace upon dhcp setup.
In some cases when more than 1 DHCP agents were assigned
to a network and then they became dead, their DHCP ports
become reserved. Later, when those agents revive or start
again, they acquire reserved ports, but it's not guaranteed
that they get exactly same ports. In such case DHCP agent
may create interface in the namespaces despite that another
interface already exist. In such case there will be two
hosts with dhcp namespaces each containing duplicate ports,
e.g. one port will be present on two hosts. This breaks
DHCP.

Closes-Bug: #1509959
Change-Id: I34eb1ad5c44dd3528c9910462e26536186e7a4fb
2015-11-13 19:55:01 +04:00