During pycodestyle fix [0], the max code complexity is temporarily
increased to 18.
This patch is a follow up to restore previous complexity (value 15),
and refactor code causing C901.
[0] https://review.openstack.org/#/c/567066
Story: #2001985
Task: #19604
Change-Id: Id64c31c449761024504284dcadd2b6c9f4a97f00
The reason we're running rollback may be because some keys are not present.
We don't want to fail due to that, see bug 1686942 for an example.
Change-Id: Iac242df9987f1ce0c7a6db4f70440fa8f2aabc46
Closes-Bug: #1686942
The i18n team has decided not to translate the logs because it seems
like it not very useful.
This are the files as of now do not have merge conflicts.
Change-Id: I082f6302f120a8c0c81482b73be301e83fe3a3a8
Partial-Bug: #1674374
AttributeError: 'int' object has no attribute 'format' will be raised
if we pass an integer value, so we should check whether the value is
a string or not.
Change-Id: I14ed4d404a9be1233493083bef49218cf0f45867
Closes-Bug: #1608393
Fix calls from .dict() to to_dict() in
IntrospectionRule.check_conditions and corresponding unit test.
Co-Authored-By: Nathan Harrison <nathan.harrison@sap.com>
Related-Bug: #1552781
Change-Id: I9fe7d400edcd7573132081a196e74eb09bc88cb7
Some conditions do not have a native counterparts, so we need a way
to invert them (aka NOT operation). This patch adds a new generic
parameter "invert", defaulting to False.
Change-Id: I50342689ba52346a5a4fbf362536b629fc688986
Conditions: ``field`` supports new format, it allow to comparison
data both from inspection and node info:
{'field': 'node://ironic/style/path', 'op': 'eq', 'value': 'val'}
{'field': 'data://introspection/path', 'op': 'eq', 'value': 'val'}
Actions: ``value`` supports fetching data from introspection, it's
using python string formatting notation:
{'action': 'set-attribute', 'path': '/driver_info/ipmi_address',
'value': '{data[inventory][bmc_address]}'}
Related-Bug: #1524753
Change-Id: Ie05f82e7a29fba2f743217f0893c085fd843cd5b
Currently our logging in processing is very inconsistent:
some log strings mention node UUID, some - node BMC IP, some nothing.
This change introduces a common prefix for all processing logs
based on as much information as possible.
Only code that actually have some context about the node (either
NodeInfo or introspection data) is updated.
Also logging BMC addresses can be disabled now.
Updates example.conf (a lot of updated comments from oslo).
Change-Id: Ib20f2acdc60bfaceed7a33467557b92857c32798
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