@ -308,13 +308,14 @@ def _create_server(module, nova):
bootkwargs = {
bootkwargs = {
'nics' : module.params['nics'],
'nics' : module.params['nics'],
'meta' : module.params['meta'],
'meta' : module.params['meta'],
'key_name': module.params['key_name'],
'security_groups': module.params['security_groups'].split(','),
'security_groups': module.params['security_groups'].split(','),
#userdata is unhyphenated in novaclient, but hyphenated here for consistency with the ec2 module:
#userdata is unhyphenated in novaclient, but hyphenated here for consistency with the ec2 module:
'userdata': module.params['user_data'],
'userdata': module.params['user_data'],
}
}
if not module.params['key_name']:
del bootkwargs['key_name']
for optional_param in ('region_name', 'key_name'):
if module.params[optional_param]:
bootkwargs[optional_param] = module.params[optional_param]
try:
try:
server = nova.servers.create(*bootargs, **bootkwargs)
server = nova.servers.create(*bootargs, **bootkwargs)
server = nova.servers.get(server.id)
server = nova.servers.get(server.id)