|
|
@ -1271,6 +1271,7 @@ class VmsModule(BaseModule):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
template = None
|
|
|
|
template = None
|
|
|
|
templates_service = self._connection.system_service().templates_service()
|
|
|
|
templates_service = self._connection.system_service().templates_service()
|
|
|
|
|
|
|
|
if self._is_new:
|
|
|
|
if self.param('template'):
|
|
|
|
if self.param('template'):
|
|
|
|
clusters_service = self._connection.system_service().clusters_service()
|
|
|
|
clusters_service = self._connection.system_service().clusters_service()
|
|
|
|
cluster = search_by_name(clusters_service, self.param('cluster'))
|
|
|
|
cluster = search_by_name(clusters_service, self.param('cluster'))
|
|
|
@ -1292,7 +1293,7 @@ class VmsModule(BaseModule):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
template = sorted(templates, key=lambda t: t.version.version_number, reverse=True)[0]
|
|
|
|
template = sorted(templates, key=lambda t: t.version.version_number, reverse=True)[0]
|
|
|
|
elif self._is_new:
|
|
|
|
else:
|
|
|
|
# If template isn't specified and VM is about to be created specify default template:
|
|
|
|
# If template isn't specified and VM is about to be created specify default template:
|
|
|
|
template = templates_service.template_service('00000000-0000-0000-0000-000000000000').get()
|
|
|
|
template = templates_service.template_service('00000000-0000-0000-0000-000000000000').get()
|
|
|
|
|
|
|
|
|
|
|
|