mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Seems that opennebula allows "spaces" on imagenames???. Fixed this removing it, and enhaced error notification in case of an image not found
This commit is contained in:
parent
b5154cbbe9
commit
ca9ad5efbd
@ -38,7 +38,7 @@ from defusedxml import minidom
|
||||
# Python bindings for OpenNebula
|
||||
from .common import sanitizeName
|
||||
|
||||
__updated__ = '2017-03-27'
|
||||
__updated__ = '2017-05-05'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -88,7 +88,10 @@ def create(api, fromTemplateId, name, toDataStore):
|
||||
continue # Skip this unknown node
|
||||
imgName = node.data
|
||||
# Locate
|
||||
imgId = imgs[imgName]
|
||||
try:
|
||||
imgId = imgs[imgName.strip()]
|
||||
except KeyError:
|
||||
raise Exception('Image "{}" could not be found!. Check the opennebula template'.format(imgName.strip()))
|
||||
else:
|
||||
fromId = True
|
||||
node = imgIds[0].childNodes[0]
|
||||
|
Loading…
Reference in New Issue
Block a user