1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixed template config removal on publication failure

This commit is contained in:
Adolfo Gómez García 2016-07-27 18:22:37 +02:00
parent a864fbac96
commit 2674563535

View File

@ -114,7 +114,11 @@ def create(api, fromTemplateId, name, toDataStore):
return six.text_type(templateId)
except Exception as e:
logger.error('Creating template on OpenNebula: {}'.format(e))
raise
try:
api.deleteTemplate(templateId) # Try to remove created template in case of fail
except Exception:
pass
raise e
def remove(api, templateId):
'''