Merge remote-tracking branch 'origin/v2.1'

This commit is contained in:
Adolfo Gómez García 2017-03-16 15:34:08 +01:00
commit d816b141b1
4 changed files with 13 additions and 13 deletions

View File

@ -8,5 +8,5 @@ Type=Application
NoDisplay=true
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
X-DBUS-StartupType=Unique
X-KDE-UniqueApplet=true
X-DBUS-StartupType=None
X-KDE-UniqueApplet=false

View File

@ -37,7 +37,7 @@ from uds.core.util import log
import pickle
import logging
__updated__ = '2016-02-26'
__updated__ = '2017-03-16'
logger = logging.getLogger(__name__)
@ -273,7 +273,7 @@ class OVirtLinkedDeployment(UserDeployment):
if self._vmid != '': # Powers off
try:
state = self.service().getMachineState(self._vmid)
if state in ('up', 'suspended'):
if state in ('up', 'powering_up', 'suspended'):
self.service().stopMachine(self._vmid)
except:
logger.debug('Can\t set machine state to stopped')
@ -372,7 +372,7 @@ class OVirtLinkedDeployment(UserDeployment):
if state == 'unknown':
raise Exception('Machine not found')
if state == 'up': # Already started, return
if state in ('up',): # Already started, return
return
if state != 'down' and state != 'suspended':

View File

@ -41,7 +41,7 @@ from uds.core.ui import gui
import logging
__updated__ = '2017-01-17'
__updated__ = '2017-03-16'
logger = logging.getLogger(__name__)
@ -165,7 +165,7 @@ class OVirtLinkedService(Service):
values=[
gui.choiceItem('disabled', 'disabled'),
gui.choiceItem('native', 'native'),
gui.choiceItem('legacy', 'legacy (deprecated)')
# gui.choiceItem('legacy', 'legacy (deprecated)'),
],
tab=_('Machine'),
defvalue='1' # Default value is the ID of the choicefield

View File

@ -10,7 +10,7 @@ import threading
import logging
import six
__updated__ = '2017-03-03'
__updated__ = '2017-03-16'
logger = logging.getLogger(__name__)
@ -65,7 +65,7 @@ class Client(object):
pass
try:
cached_api_key = aKey
cached_api = ovirt.Connection(url='https://' + self._host + '/ovirt-engine/api', username=self._username, password=self._password, timeout=self._timeout, insecure=True, debug=True)
cached_api = ovirt.Connection(url='https://' + self._host + '/ovirt-engine/api', username=self._username, password=self._password, timeout=self._timeout, insecure=True) # , debug=True, log=logger )
return cached_api
except:
logger.exception('Exception connection ovirt at {0}'.format(self._host))
@ -458,10 +458,10 @@ class Client(object):
cluster = ovirt.types.Cluster(id=six.binary_type(clusterId))
template = ovirt.types.Template(id=six.binary_type(templateId))
if usbType in ('native', 'legacy'):
usb = ovirt.types.Usb(enabled=True, type=ovirt.types.UsbType.NATIVE if usbType == 'native' else ovirt.types.UsbType.LEGACY)
else:
usb = ovirt.types.Usb(enabled=False)
# if usbType in ('native',): # Removed 'legacy', from 3.6 is not used anymore, and from 4.0 not available
# usb = ovirt.types.Usb(enabled=True, type=ovirt.types.UsbType.NATIVE)
# else:
usb = ovirt.types.Usb(enabled=False)
memoryPolicy = ovirt.types.MemoryPolicy(guaranteed=guaranteedMB * 1024 * 1024)
par = ovirt.types.Vm(name=name, cluster=cluster, template=template, description=comments,