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:
parent
a864fbac96
commit
2674563535
@ -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):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user