You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 withincompute
is being ignored.Environment
Steps to reproduce
E.g. setting a value for
total_ram
global field: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 thecompute
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 callingopenstack.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.The text was updated successfully, but these errors were encountered: