Bug 1899192
| Summary: | server_groups attribute does not match the Compute API spec | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Emilien Macchi <emacchi> |
| Component: | python-openstacksdk | Assignee: | Emilien Macchi <emacchi> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | rlobillo |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 16.1 (Train) | CC: | apevec, jjoyce, jschluet, lhh, pgrist, rlobillo |
| Target Milestone: | --- | Keywords: | TestOnly, Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python-openstacksdk-0.36.4-1.20201113235938.el8ost | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-10-16 10:32:57 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1891816 | ||
Severity is high: if you need this feature there's no good workaround. According to our records, this should be resolved by python-openstacksdk-0.36.4-1.20210310100715.76d3b29.el8ost. This build is available now. Verified on RHOS-16.1-RHEL-8-20230510.n.1
$ rpm -qa | grep openstacksdk
python3-openstacksdk-0.36.4-1.20210528025852.76d3b29.el8ost.noarch
$ openstack server show ostest-gwvwg-master-0 -vvvv 2>&1 | grep "^RESP BODY:" | awk -F"RESP BODY:" '{print $2}' | tail -1 | jq .server.server_groups
[
"6752b29c-a95e-4121-9fca-d57aeebb2390"
]
|
Description of problem: server_groups in Server class is defined as a list of dict, however the Compute API 2.7.1+ returns a list of UUID, i.e. str here. This will raise the following error: dictionary update sequence element #0 has length 1; 2 is required File ".../python3.7/site-packages/openstack/resource.py", line 1409, in fetch self._translate_response(response, **kwargs) File ".../python3.7/site-packages/openstack/resource.py", line 1140, in _translate_response dict.update(self, self.to_dict()) File ".../python3.7/site-packages/openstack/resource.py", line 971, in to_dict value = getattr(self, attr, None) File ".../python3.7/site-packages/openstack/resource.py", line 582, in __getattribute__ return object.__getattribute__(self, name) File ".../python3.7/site-packages/openstack/resource.py", line 166, in __get__ return _convert_type(value, self.type, self.list_type) File ".../python3.7/site-packages/openstack/resource.py", line 66, in _convert_type ret.append(_convert_type(raw, list_type)) File ".../python3.7/site-packages/openstack/resource.py", line 82, in _convert_type return data_type(value) I am using this through Ansible OpenStack Inventory Plugin. Version-Release number of selected component (if applicable): OSP16 How reproducible: Use the Ansible module "os_server" to create a VM against a cloud running OSP16.