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

Default values for compute's global fields are overriding the ones set statically (through config file) #213

Open
orviz opened this issue Jan 22, 2021 · 0 comments
Labels

Comments

@orviz
Copy link
Contributor

orviz commented Jan 22, 2021

Short Description of the issue

If a default value is set for a global field inside static.get_compute_endpoint_defaults(), this value is overriding the one set in the YAML configuration file. If this bug gets confirmed, any global field set by the user within compute is being ignored.

Environment

  • Operating System: Debian 10
  • python version: 3.9.1
  • OpenStack version: Rocky

Steps to reproduce

E.g. setting a value for total_ram global field:

compute:
  total_ram: 600

results in:

GLUE2CloudComputingManagerTotalRAM: 0

However, if set under endpoints:defaults the result is the expected one. In the current OpenStack sample the field is at the compute level, not at the endpoint level, so it really looks like a bug.

Summary of proposed changes

The priority (lower to higher) should be: defaul values -> static values -> dynamic values

The current logic implemented for obtaining the static info and merging it with the dynamic one is rather burdensome & difficult to follow (_get_what(), get_defaults_from_yaml(), get_fields_and_prefix(), populate_default_values(), ..). Besides, once the default & static info is obtained, the dynamic info relies once again on the defaults (by calling openstack.get_compute_endpoints_defaults() method) from the static provider.

It would be better to move to a plain simple solution, even though this implies that some of the current magic is removed from the code. Built-in python solutions like collections.defaultdict can reduce substantially the current implementation.

@gwarf gwarf added the bug label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants