Despite what Nova's api-ref currently says [1], the 'addSecurityGroup'
action only requires a security group name if using nova-network: it
will happily accept either a name or ID if using neutron.
We are using 'Proxy._get_resource' to allow users to pass either an ID
or an 'openstack.network.v2.security_group.SecurityGroup' object
(there's no implementation of Nova's deprecated SecurityGroup resource).
If given an ID, this help method will only populate the 'id' field of
the created resource. Thus, we need to use this if provided.
[1] https://docs.openstack.org/api-ref/compute/#add-security-group-to-a-server-addsecuritygroup-action
Change-Id: I3dd56414b32207a16c6c83971f0494ccb86e07d4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2089821
(cherry picked from commit ad6beea71d)