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
OpenStack has a slightly different semantic for the tags in comparison with AWS, OpenStack tags are a list of values while in AWS is a list of key-value. OpenStack has properties which are equivalent to AWS tags.
I expected to get the list of instances that don't have the tag locked set, and I get the error AttributeError: 'list' object has no attribute 'get' instead.
Cloud Provider
OpenStack (Alpha)
Cloud Custodian version and dependency information
policies:
- name: test
resource: openstack.server
filters:
- "tag:locked": absent
Relevant log/traceback output
2022-08-10 14:27:50,661: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/policy.py", line 290, in run
resources = self.policy.resource_manager.resources()
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n_openstack/query.py", line 99, in resources
return self.filter_resources(resources)
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/manager.py", line 111, in filter_resources
resources = f.process(resources, event)
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 553, in process
return super(ValueFilter, self).process(resources, event)
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 190, in process
return list(filter(self, resources))
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 540, in __call__
matched = self.match(i)
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 576, in match
r = self.get_resource_value(self.k, i)
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 556, in get_resource_value
return super(ValueFilter, self).get_resource_value(k, i, self.data.get('value_regex'))
File "/home/freyes/.local/pipx/venvs/c7n/lib/python3.10/site-packages/c7n/filters/core.py", line 246, in get_resource_value
r = i.get('tags', {}).get(tk, None)
AttributeError: 'list' object has no attribute 'get'
Extra information or context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
c7n fails to filter OpenStack instances by tags.
OpenStack has a slightly different semantic for the
tags
in comparison with AWS, OpenStack tags are a list of values while in AWS is a list of key-value. OpenStack hasproperties
which are equivalent to AWS tags.Here it's an example of a running instance:
What did you expect to happen?
I expected to get the list of instances that don't have the tag
locked
set, and I get the errorAttributeError: 'list' object has no attribute 'get'
instead.Cloud Provider
OpenStack (Alpha)
Cloud Custodian version and dependency information
Policy
Relevant log/traceback output
Extra information or context
No response
The text was updated successfully, but these errors were encountered: