Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "esi mdc baremetal node list" work #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

larsks
Copy link
Member

@larsks larsks commented Jan 24, 2025

OpenStackConfig.get_all() will fail with a keystone exception if there are
any OS_* variables set in the environment 1. This is easy to trigger if,
for example, you have set OS_BAREMETAL_API_VERSION in your environment to
work around 2.

We can avoid the problem by removing the call to get_all(), and
instead initializing the list of clouds using get_cloud_names().

This commit makes a number of additional changes to
esiclient/v1/mdc/mdc_node_baremetal.py:

  • Several attribute names appear to have changed since this code was
    written (node.uuid is now node.id; node.instance_uuid is now
    node.instance_id).

  • Replace single-letter variable names with more meaningful names.

  • Add the '--ignore-invalid' command, which allows the command to continue
    in the event that it cannot successfully connect to one or more clouds.

@larsks larsks changed the title fix/mdc Make "esi mdc baremetal node list" work Jan 24, 2025
@larsks
Copy link
Member Author

larsks commented Jan 24, 2025

This PR was sort of an accident, because I was looking at setup.cfg and found myself asking, "what the heck is this mdc subcommand?".

OpenStackConfig.get_all() will fail with a keystone exception if there are
any OS_* variables set in the environment [1]. This is easy to trigger if,
for example, you have set OS_BAREMETAL_API_VERSION in your environment to
work around [2].

We can avoid the problem by removing the call to get_all(), and
instead initializing the list of clouds using get_cloud_names().

This commit makes a number of additional changes to
esiclient/v1/mdc/mdc_node_baremetal.py:

- Several attribute names appear to have changed since this code was
  written (node.uuid is now node.id; node.instance_uuid is now
  node.instance_id).

- Replace single-letter variable names with more meaningful names.

- Add the '--ignore-invalid' command, which allows the command to continue
  in the event that it cannot successfully connect to one or more clouds.

[1]: https://bugs.launchpad.net/openstacksdk/+bug/2096621
[2]: CCI-MOC/esi#669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant