Merge pull request #1444 from ssssam/sam/os-server-nics-parameter

os_server: Add some error checking for the 'nics' parameter
This commit is contained in:
Brian Coca 2015-12-21 12:56:40 -05:00
commit e8b70d4e00

View file

@ -372,7 +372,14 @@ def _network_args(module, cloud):
args = []
nics = module.params['nics']
if type(nics) != list:
module.fail_json(msg='The \'nics\' parameter must be a list.')
for net in _parse_nics(nics):
if type(net) != dict:
module.fail_json(
msg='Each entry in the \'nics\' parameter must be a dict.')
if net.get('net-id'):
args.append(net)
elif net.get('net-name'):