Commit Graph

12 Commits

Author SHA1 Message Date
Vladyslav Drok c3b316677c Do not reset FSM when ironic ports cant be queried
It can cause problems, as if a single sync fails, FSM state will be
reset and not put back to initialized state until inspector restart.

Change-Id: I24b08612c4ffc6aca60ca08f3ff5cc769c7c041d
Story: #2008971
Task: #42611
2021-06-14 17:14:54 +03:00
Harald Jensås 7a067a97a8 pxe filter - option to always block unknown hosts
It is not always desired to open the DHCP server for any host
just because introspection is active. Add an option to ensure
that only nodes being introspected are added to the DHCP servers
allow list.

Also adds ethoib support in the dnsmasq PXE filter.

Also fix a typo in ethoib_interfaces option help text.

Change-Id: I4cd7f4f0a449dcc23897ec9288cb57ec9bd647d7
2020-09-28 12:18:00 +02:00
Harald Jensås a1f8926cd1 Remove non-inclusive language in pxe filter
Replaces the use of black/white-list with deny/allow-list
in the pxe filter.

Change-Id: I84e6343fc13e4c4c02521499632a07e782088057
2020-07-09 12:06:03 +02:00
Dmitry Tantsur cee5922674 Hacking: enforce usage of autospec=True in tests
Using autospec ensures that mocked functions are called with correct
arguments, so it's highly desired to have it.

Change-Id: I9c8395adf852495d2ef6db732d727990e8abd5d7
2020-04-28 12:27:41 +02:00
Sean McGinnis a9f7f67de5
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ic67f09a223ae2d0cb460771a10a4122307afa05b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 16:15:28 -05:00
Riccardo Pittau 3accdfbbc6 Use openstacksdk for ironic module
This patches removes the ironic-client dependency from the
ironic module in favor of openstacksdk.

Increase minimum required version of openstacksdk to use
recent added features.

Change-Id: I31964179835ad454e8205a59f483b419de4fb62d
2020-03-23 14:28:09 +01:00
Riccardo Pittau 9b1450398c Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: Ic443c7e4d5a5a849c4dc220207f8957e4c90bf53
2019-12-17 09:23:01 +01:00
Dongcan Ye dc7e4d26ae pxe_filter: fix get blacklist error
According to [1], the Port address and extra
field in the same level.

Method _get_blacklist should pass port list instead
port.address list for InfiniBand mapping.

[1] https://github.com/openstack/ironic/blob/master/ironic/objects/port.py

Story: 2005729
Task: 31077
Change-Id: Iedc321c840f18fc1aa856b857da2c35318a538ae
2019-05-18 08:38:29 +00:00
Kaifeng Wang f37eb0fc58 Support ip6tables for iptables pxe filter
Adds a configuration option [iptables]ip_version to specify the
desired ip version for the iptables pxe filter, which can be set to
4 or 6. When set to 6, the iptables pxe filter will use ip6tables
command to manage rules for the port 547 which is the port of DHCPv6
server side.

The string type is used to make room for the future, when there is need
to automatically determine ip version from the binding interface.

Change-Id: I7de2be5950a23def3ec6490f2e6dfa3d5c42798a
Story: 1756012
Task: 11411
2018-11-07 09:53:47 +08:00
Kaifeng Wang 1ef55e3603 Replace subprocess with processutils
Trying to fix the dsvm-python3 job.

Depends-On: https://review.openstack.org/608620
Change-Id: Ibdfed9545a26e752ab7aeed2db122a368c3c06fb
2018-10-08 11:45:25 +02:00
Dmitry Tantsur 3237511cc6 Retry port lists on failure in PXE filter periodic sync
These calls are subject to transient network problems, we should
not abort ironic-inspector process in this case. Also due to
bug 1748893 the port listing API can sometimes return HTTP 400.

This change retries port listing 5 times with 1 second break
before aborting the periodic task and thus the process.

This change introduces a dependency on the retrying library,
which is already widely used in OpenStack (including ironic).

Change-Id: I92fd70ca5692ce9f6798eedf9e540d5aa7c6f1af
Closes-Bug: #1748893
2018-02-14 15:10:39 +01:00
dparalen 7b27585463 Refactoring the firewall
Adopting the PXE filter interface/driver concept

Related-Bug: 1665666
Change-Id: If83db978080b9c4e5d51ba50bbe8ed26e29abe83
2017-10-19 16:38:15 +02:00