mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-11 05:17:55 +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
|
# Python bindings for OpenNebula
|
||||||
from .common import sanitizeName
|
from .common import sanitizeName
|
||||||
|
|
||||||
__updated__ = '2017-03-27'
|
__updated__ = '2017-05-05'
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -88,7 +88,10 @@ def create(api, fromTemplateId, name, toDataStore):
|
|||||||
continue # Skip this unknown node
|
continue # Skip this unknown node
|
||||||
imgName = node.data
|
imgName = node.data
|
||||||
# Locate
|
# 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:
|
else:
|
||||||
fromId = True
|
fromId = True
|
||||||
node = imgIds[0].childNodes[0]
|
node = imgIds[0].childNodes[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user