15 Commits

Author SHA1 Message Date
Sharpz7
ddde31af73 [codespell] Fixing Spelling Mistakes
This is the first in a series of commits to add support for codespell. This is continuning the process completed in ironic-python-agent.

Future Commits will add a Tox Target, CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: I823dfa7bd49c51f4eb7507cae67b4ef3b4e1cd6f
2024-11-13 20:31:35 +00:00
Iury Gregory Melo Ferreira
5abd97149c Py2 - Remove six, mock and future
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 , switches the mock library
to unittest.mock and removes future.

Change-Id: I71b11f13691d13df162b203f7ea5979b30c272df
2020-05-04 15:22:23 +02:00
Riccardo Pittau
ece9f6e25f Add pep8 import order check
Set flake8-import-order version to 0.17.1
Full py3 compatible version.
Add all Python3 modules to stdlib list.
Also includes fix to an enum34 dependency bug.

Change-Id: I58dd80fc33942656c69ce67ee523a1d57f693e93
2020-04-21 16:26:52 +02:00
Mark Goddard
8df4a68fb1 Fix node scheduling with pipe in hostvars
If Ansible hostvars contain a pipe (|) character, this can cause
problems during scheduling as Ansible fails during Jinja templating.
This is probably a bug in Ansible/Jinja.

The particular case where this was hit was when using screen, the
TERMCAP environment variable gets set to something beginning with
'SC|screen|VT'.

This change addresses the issue by moving the capture of hostvars inside
the tenks_update_state action plugin rather than evaluating them in a
playbook.

Change-Id: Ibef91d9ef499c8741b61a170672a23f530a600bb
2020-03-20 10:59:30 +00:00
Mark Goddard
c5c18ce04f Allow setting node and volume name prefixes per-spec
Adds support for setting node and volume name prefixes on a per-spec
basis.  This allows for different node specifications to use different
names, e.g.  'controller' vs 'compute'.

This change also fixes an issue where node names were not globally unique, only
unique on a given hypervisor. This could cause issues if used with multiple
hypervisors.

This has been done by rewriting the scheduling logic, replacing the 'node
index' concept with a more concrete reservation of IPMI ports (which are
allocated per hypervisor), and decoupling this from generation of node names
(which are allocated globally).

Change-Id: I929b18918c2886f42c4d05b37c81f3e63c69a92f
Story: 2004894
Task: 29201
Story: 31d2681
Task: 29248
2019-01-31 11:24:58 +00:00
Mark Goddard
50cf161bf9 Pass node and volume name prefixes to tenks_update_state
node_name_prefix (default tk0) can be used to set a custom prefix for the node
names.

vol_name_prefix (default vol) can be used to set a custom prefix for the volume
names.

Support already existed for these in the action plugin, but the variables were
not passed through.

Change-Id: If968707285f9a8450bf16ca7a4956de6164986de
TrivialFix
2018-11-26 10:41:56 +00:00
Mark Goddard
6a2fb44a78 Fix deploy and teardown without node enrolment
If the ironic_config field is not present in a node definition, then
that node should not be registered with ironic. In this case we also
don't need to query glance for images or wait for resources to appear
in placement.

If nova_flavors is empty, we do not need to register flavors, so no need
to install the client or check for OS_USERNAME.

Also fixes an issue in the action plugin where it would fail if
ironic_config field is not present in a node definition.

Finally, in CI deploy/teardown tests, rather than skipping tasks, we now
remove the ironic_config field from the node definition, and set
nova_flavors to empty, such that we exercise these code paths.

Change-Id: I29b42665f1609c99e80f12ab6f3815d0e0918dae
Story: 2004412
Task: 28056
2018-11-22 19:20:59 +00:00
Will Miller
1f4127c184 Prefix volume names with node name
Each volume needs its own volume, so to ensure separate volumes are
created for every node, give each volume a unique name comprising the
parent node's name and the volume's index within the node's volume list.
2018-09-20 10:52:08 +00:00
Will Miller
c0227d29b4 Move absent node pruning to cleanup section
Add a cleanup_state.yml playbook that is run after every deployment and
teardown. It will remove any nodes marked as 'absent' from the state
file, by calling schedule.py with `prune_only=True`.
2018-09-18 16:28:34 +00:00
Will Miller
56a469ffdf Remove unnecessary test 2018-09-17 08:54:16 +00:00
Will Miller
08940e1d94 Save task arguments and vars in object
Rather than passing these args through various sub-routines, make them
accessible through the action plugin object.
2018-09-14 16:39:30 +00:00
Will Miller
794bffd701 Add basis for action plugin tests 2018-09-14 13:35:27 +00:00
Will Miller
78dfa05258 Update documentation
* Improve comments in tenks_update_state
* Add limitations section to README
* Add hosts blurb to README
* Add reconfiguration blurb to README
2018-09-14 11:59:10 +00:00
Will Miller
99eaf48098 Persist physnet indices in state file
Instead of overwriting the physnet mappings specified in the Tenks
configuration, create a separate dict that maps physnet names to their
indices. Like physnet_mappings, this will be present for each
hypervisor.
2018-09-14 10:27:21 +00:00
Will Miller
caffd7bfaf Add new tenks_state_update plugin
Instead of just an allocations file, Tenks now uses a 'state' file. This
contains the node allocations, as well as physical network mappings and
indices. Clusters can also now be re-deployed with different specs to
update the state.
2018-09-13 16:58:50 +00:00