The same information can be fetched from unprocessed introspection data,
which has an advantage of working without swift.
Change-Id: Id65644c27c78bb2c476166eb9095ef6acd94db7b
We've been historically using endpoints without trailing slashes in
our API. Apparently, some libraries (like gophercloud) are quite
opinionated about it (see the story), so let's handle both.
The implementation could be simpler if we just added trailing slash
to all routes, but it would cause redirects for current users.
Change-Id: Icbd971a8e792f93f9c3fa66ba29bec055dcdee32
Story: #2007660
Task: #39749
Without manage_boot the only real action we do is updating the firewall,
which is supposed to be pretty fast. Making the call synchronous means
that ironic will receive information about PXE filter failures and will
not attempt to power on a failed node or before the PXE filter is updated.
Change-Id: I95b63d4e1d4c2c186c0e8234c4382b00aa918aa8
Story: #2007658
Task: #39746
When boot is managed by the ironic side, a node is powered on
right after starting introspection. Inspector's own delays play
no role and may actually prevent introspectin from happening if
a node boots faster than it's whitelisted in the PXE filter.
This changes moves the delay handling later in the process and
only does it when manage_boot is True.
Change-Id: If7de8b66ea42eff2966c62a9a0529ab9a5c06f26
Story: #2007658
Task: #39745
It's nice to know when a periodic task fails, but aborting the whole
process makes it fragile in the events of e.g. problems with accessing
ironic, even if transient.
Simplify the overly complex unit tests and split the dual-purpose task.
Story: #2007622
Task: #39653
Change-Id: I64f5ca6e377a4cdfa08319ef9973b591cc552121
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
https://github.com/eventlet/eventlet/issues/592
Change-Id: If5c4fc8dd8f3dfe87baf1d10a21ff4333cb00e42
Story: 2007614
Using autospec ensures that mocked functions are called with correct
arguments, so it's highly desired to have it.
Change-Id: I9c8395adf852495d2ef6db732d727990e8abd5d7
This is a follow up to comments on https://review.opendev.org/720010.
Adding autospect=True requires an update to ironic_inspector.test.\
base.BaseTest.assertCalledWithPatch.
Also add autospec=True in several mocks where it was not used.
Change-Id: Ia340d7a8ecde1c8cf191555de87b11b19b30f06c
- Removes confusing comment in _get_physnet_patch method.
- Move binary operator to follow code style.
- Removed info log entry in before_update.
- Move releasenote to 'other' section as this is no user
faceing change.
Change-Id: I53d8bf97a87ae365a085a795901eaed1f0c32d9b
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>
The physnet_cidr_map hook adds functionality to
populate the physical_network of a baremetal port based
on a cidr-to-physnet mapping in configuration.
Related-Bug: #1870529
Change-Id: I43cdac5ccd8c46836b26f6e4bc0d4509958e2e79
This base class contains the basic logic for assigning a physical
network to ironic ports. Subclasses should implement the mechanism for
determining how to map ports to a physical network based on the
introspection data.
Authored-By: Mark Goddard <mark@stackhpc.com>
Co-Authored-By: Harald Jensås <hjensas@redhat.com>
Change-Id: I4f6fc9e3d5692075ceb4f38fa04ed54aa22a1d8b
Added 'scope' property to IntrospectionRule and logic to check if a node
falls in the same scope.This allows introspection rules to be applied on
selected nodes instead of every one of them.
Story: 2006995
Task: 37763
Change-Id: I77034f032ea0ec16886afdd928546eb801f7a90a
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
This option has been created to work around flacky hardware that
does not work correctly with temporary boot. However, ironic-inspector
unconditionally uses persistent=False. This change fixes it.
Story: #2007093
Task: #38126
Change-Id: Ie21e5beeec6188e3b979c28167e575e1c37087ee
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
Short-circuit the port update logic for active nodes to allow only
for the addition of new ports.
Story: #2006956
Task: #37645
Change-Id: Ifd870a8465b6643578299dc86e2eae023db6ae43
Add detail=True to make sure the inspector gets the node_uuid
from the port list when inspecting active nodes,
Change-Id: I1378a1a4d2a35ba8f182138877b5151f25d4c56d
Story: #2006950
When manage_boot is False, we do not power on the machines on starting
introspection, nor do we power them off on aborting. We should not
power off on finishing introspection either, let's leave it up to ironic.
Change-Id: If8115f8d592e1b24b07ef52bcd703d10763c1f00
Story: #1528920
It's already done by processutils (with stdout and stderr as well),
so it only leads to duplicate log records.
Change-Id: Ie9a06c577523cd3dd4c7b74a33642790eb89a8fb
This causes the values to be evaluated at import time, which makes
it harder to import such modules in functional tests.
Change-Id: I1fc69058f737ef3ab9e703968d05a2d77fc57fdb