This patch allows for API discovery via the root API endpoint and
version endpoints. These endpoints will return a json blob containing
all the information required to talk to the different API versions and
resources.
Change-Id: Id427f1ca542523afb3513b047e32b5aad39bf743
Closes-Bug: #1477959
This patch introduces a simple JSON-based DSL to run on introspected
data. Conditions and actions are provided via new plugin entry points.
This patch is missing PUT operation on a rule, this can be added later.
Also not all planned conditions and actions are added in this patch,
will also follow up.
Implements: blueprint rules
Change-Id: If4d17b5f1462d03879cb4c2ff4e5cb3ea364b697
This code makes assumption that importing oslo_config.cfg is enough
to get our options, which is of course not true. It happens to work now,
as we seem to import ironic_inspector.conf (actual module defining
configuration options) somewhere else before this code is run.
When building an RPM, however, we run tests a bit differently, and
this problems leads to NoSuchOptError: no such option:
introspection_delay_drivers.
Closes-Bug: #1494649
Change-Id: I3524222418a12270c78c6ee61d4a4afa1353306e
Allows for much cleaner and complete testing, also simplifies future
changes.
Change-Id: Ia586c21ff8e6e6449c6048d4764d1d12259ab0ba
Partial-Bug: #1492946
Accept ironic object in NodeInfo __init__ instead of every method
to reduce number of times we need to pass it around.
Add new methods to NodeInfo: patch, update_properties,
update_capabilities, patch_port and delete_port.
Change-Id: Ida03ac70e743f53f887bb194f61b0011950d4dfd
Partial-Bug: #1492946
* Recommend using ENROLL for setting IPMI credentials
* Deprecate using maintenance mode, will be dropped once we stop
supporting Ironic Kilo
* Drop bits related to Ironic Juno, we no longer support it
* Clarify error message about wrong provision state, stop mentioning
maintenance mode there
Change-Id: I3a9d3ba24a32c7844cd6fd5e4f8ec4b15b2d9d20
Closes-Bug: #1479331
This adds the ability to store all of the data collected
during introspection. The configuration option
"[processing] store_data" (defaults to 'none'), determines
this behavior. Initially, only 'none' and 'swift' are
supported. If 'swift' is used, the data is stored in Swift
with the object name of "inspector_data-<UUID>".
Adds an endpoint /v1/introspection/<UUID>/data which
retrieves the data according to the method in
"[processing] store_data". Returns 404 if this option
is disabled.
There is a further option to store the location of the data
in the Ironic Node.extra column. For 'swift', this will be
the name of the swift object. The option,
"[processing] store_data_location" determines the key
name in the Node.extra column. (defaults to not storing
the location).
Change-Id: Ibc38064f7ea56f85b9f5a77ef6f62a50f0381ff4
Implements: blueprint store-introspection-data
We'll soon have root_device_hints plugin, so it will become confusing.
Also added a test that we can use it under new name.
Change-Id: I049e049002cb25afc5aadb9a7a9e5d026a6810fd
This test wasn't mocking socket, therefore was calling a real command out
to the test runners local network, which lead to unpredictable results.
This patch mocks and adds a sideeffect to the socket command to ensure
that it is behaving as expected for the test.
Change-Id: Ie9ab0a12c0d26ae4fa571941e181ebbf800b8ceb
It's the same as func, but runs functional tests with Python 3.
One issue was fixed in ironic_inspector.test.functional.
Change-Id: I6a081ad2ca8857018c6b531ed82182aab0ccca4d
Currently, Ironic Inspector talks with Swift using public API endpoint.
This patch fix this by making endpoint type configurable and also make
default value "internalURL".
Change-Id: Iab7d6a995d484bebb4338ffd307afcea132c0f20
Closes-Bug: #1470565
Add below procedure to periodic_clean_up() in order to sync data
with Ironic.
* Get Ironic's node list by executing python-ironicclient's node.list()
* Compare above Ironic-node-list and cache
* If node in cache is not exist in Ironic-node-list,
delete data from cache.
Change-Id: I606b0a76559b8bd2845d58146086b1019712dc34
Implements: blueprint delete-db-api
Without this it's hard to debug look up issues.
This change required NodeInfo to expose attributes.
Change-Id: Ieba14ab14dd356cc2c099656201c24fa46cbff6d
We'll have database code not related to node_cache, i.e. table
for rules.
Change-Id: I58a98d9250e7ca136b3d79e44177faa401f5c29e
Implements: blueprint rules
This is Kilo, so make it clear in README that we actually still
support it (only stand alone case).
Change-Id: I9a5bd97a2a33a12311626bb3fae878bfb5c9d53c
Also adds endpoints / and /v1 returning {} that a client can
use to learn current API versions.
Functional testing code is updated to support API versions.
Change-Id: I4ada89a0f5128dea2234ae652222dc9b7f408502
Implements: blueprint api-versioning
Using client library here is not convenient, as it does not have
new features we need to test. Also we should only test API itself.
Instead, we'll use new Base class and mocked_server context manager
to build a separate functional test for client.
Change-Id: I44250d3df0d202e5fe5f94e6ec553a1f86053637
KVM PXE code seems broken in an interesting way, when you try to PXE
boot too many nodes. This change makes inspector sleep configurable
amount of time between powering on nodes with *_ssh driver.
Work around in devstack/exercise.sh is no longer needed and is dropped.
Note that this change is not HA, so we might revisit it in the future.
Change-Id: I9b16592f9b5130e90c02fce1b421887f451e397b
Closes-Bug: #1473024
Currently, Ironic-inspector uses SQLite as database.
We should migrate to oslo.db.
In this patch, make database connect operations to oslo_db.
Change-Id: Ibd0f787b570bc101eab9fbd0b59d8a775a95e2e0
Implements: blueprint migrate-to-oslodb
With integration tests on the radar we no longer need to do
integration checking between ramdisk code and inspector here.
Also copy integration test script from functest to devstack.
Once we update the gate to use the new script, the whole functest
directory should be deleted.
Change-Id: Ic29e954fac1c535cb4f83d46ccea9ebfb80f840c
Closes-Bug: #1468748
This patch deprecates the authenticate configuration option in favor of
a more ironic like auth_strategy option.
Those already using the authenticate option shouldn't be affected by
this change however the authenticate option should be completely
removed in the future.
Change-Id: If9b1f24a8a9a73c93d46d884a24658ac9556ced2
Closes-Bug: #1462365
This patch removes the check when the inspector starts that ensures
that ironic is already running, because it could lead to problems when
bringing up services in a distributed environment where order and timing
isn't guaranteed.
Change-Id: I2a8ee74db781a087a8ecb0c73ddc461a6b326101
Closes-Bug: #1462993
Previously we used just strings. It's not a breaking change in terms
of API, but it will lead to less readable errors for older clients.
Nice side effect of this change is that exceptions are no longer
reported as HTML.
In-tree client was updated, as separate one is not set up yet.
Change-Id: Ice3111e08f8716d904efc4869c6d2ded25e23e2e
Closes-Bug: #1465347