Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1899192

Summary: server_groups attribute does not match the Compute API spec
Product: Red Hat OpenStack Reporter: Emilien Macchi <emacchi>
Component: python-openstacksdkAssignee: 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    

Description Emilien Macchi 2020-11-18 17:19:51 UTC
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.

Comment 2 Matthew Booth 2021-01-21 14:13:40 UTC
Severity is high: if you need this feature there's no good workaround.

Comment 3 Lon Hohberger 2021-05-27 11:05:16 UTC
According to our records, this should be resolved by python-openstacksdk-0.36.4-1.20210310100715.76d3b29.el8ost.  This build is available now.

Comment 5 rlobillo 2023-10-16 08:32:02 UTC
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"
]