'allowed_nodes' in ComputeScope does not work as intended

Bug #1988981 reported by Pavel Specian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
New
Undecided
Unassigned

Bug Description

When availability_zone is defined in compute scope, this part of the code is called:
https://opendev.org/openstack/watcher/src/commit/bf69546224f248ba81c1d4114c62697be3751e97/watcher/decision_engine/scope/compute.py#L156:

self._collect_zones(rule['availability_zones'],
                                    allowed_nodes)

This leads to:
https://opendev.org/openstack/watcher/src/commit/bf69546224f248ba81c1d4114c62697be3751e97/watcher/decision_engine/scope/compute.py#L82:

allowed_nodes.extend(service.host)

'service.host' returns a hostname(str) which when used with extend() on an allowed_nodes list leads to something like this:

>>> x = []
>>> host = "host.example.com"
>>> x.extend(host)
>>> print(x)
['h', 'o', 's', 't', '.', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm']
>>>

This further breaks the logic of this:
https://opendev.org/openstack/watcher/src/commit/bf69546224f248ba81c1d4114c62697be3751e97/watcher/decision_engine/scope/compute.py#L203

Tags: scope xena
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.