cs_physical_network: use name as param for network (#54602)

This commit is contained in:
René Moser 2019-03-29 15:45:01 +01:00 committed by ansibot
parent b0d0a3a2f8
commit 9cdad6a01e

View file

@ -22,12 +22,12 @@ author:
- Netservers Ltd. (@netservers) - Netservers Ltd. (@netservers)
- Patryk Cichy (@PatTheSilent) - Patryk Cichy (@PatTheSilent)
options: options:
physical_network: name:
description: description:
- Name of the physical network. - Name of the physical network.
required: true required: true
aliases: aliases:
- name - physical_network
type: str type: str
zone: zone:
description: description:
@ -231,7 +231,7 @@ class AnsibleCloudStackPhysicalNetwork(AnsibleCloudStack):
def _get_common_args(self): def _get_common_args(self):
args = { args = {
'name': self.module.params.get('physical_network'), 'name': self.module.params.get('name'),
'isolationmethods': self.module.params.get('isolation_method'), 'isolationmethods': self.module.params.get('isolation_method'),
'broadcastdomainrange': self.module.params.get('broadcast_domain_range'), 'broadcastdomainrange': self.module.params.get('broadcast_domain_range'),
'networkspeed': self.module.params.get('network_speed'), 'networkspeed': self.module.params.get('network_speed'),
@ -245,7 +245,7 @@ class AnsibleCloudStackPhysicalNetwork(AnsibleCloudStack):
return args return args
def get_physical_network(self, key=None): def get_physical_network(self, key=None):
physical_network = self.module.params.get('physical_network') physical_network = self.module.params.get('name')
if self.physical_network: if self.physical_network:
return self._get_by_key(key, self.physical_network) return self._get_by_key(key, self.physical_network)
@ -423,7 +423,7 @@ class AnsibleCloudStackPhysicalNetwork(AnsibleCloudStack):
def main(): def main():
argument_spec = cs_argument_spec() argument_spec = cs_argument_spec()
argument_spec.update(dict( argument_spec.update(dict(
physical_network=dict(required=True, aliases=['name']), name=dict(required=True, aliases=['physical_network']),
zone=dict(), zone=dict(),
domain=dict(), domain=dict(),
vlan=dict(), vlan=dict(),