mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 13:21:25 -07:00
Add support for port-id,port-name to nics in os_server
This commit is contained in:
parent
75473c0fd0
commit
d26bff8162
1 changed files with 9 additions and 0 deletions
|
@ -262,6 +262,15 @@ def _network_args(module, cloud):
|
||||||
msg='Could not find network by net-name: %s' %
|
msg='Could not find network by net-name: %s' %
|
||||||
net['net-name'])
|
net['net-name'])
|
||||||
args.append({'net-id': by_name['id']})
|
args.append({'net-id': by_name['id']})
|
||||||
|
elif net.get('port-id'):
|
||||||
|
args.append(net)
|
||||||
|
elif net.get('port-name'):
|
||||||
|
by_name = cloud.get_port(net['port-name'])
|
||||||
|
if not by_name:
|
||||||
|
module.fail_json(
|
||||||
|
msg='Could not find port by port-name: %s' %
|
||||||
|
net['port-name'])
|
||||||
|
args.append({'port-id': by_name['id']})
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue