mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-10 01:17:59 +03:00
Merge remote-tracking branch 'origin/v1.9'
# Conflicts: # server/src/uds/services/OVirt/OVirtProvider.py # server/src/uds/services/OVirt/client/oVirtClient.py Conflicts resolved
This commit is contained in:
commit
df2dcf7acd
@ -45,7 +45,11 @@ from .client import oVirtClient
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
__updated__ = '2015-09-12'
|
__updated__ = '2015-09-12'
|
||||||
|
=======
|
||||||
|
__updated__ = '2015-09-21'
|
||||||
|
>>>>>>> origin/v1.9
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -9,8 +9,9 @@ from ovirtsdk.api import API
|
|||||||
|
|
||||||
import threading
|
import threading
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
__updated__ = '2015-09-07'
|
__updated__ = '2015-09-21'
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -90,17 +91,24 @@ class Client(object):
|
|||||||
finally:
|
finally:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
|
def _isFullyFunctionalVersion(self, api):
|
||||||
|
'''
|
||||||
|
Same as isFullyFunctionalVersion, but without locking. For internal use only
|
||||||
|
'''
|
||||||
|
version = re.search('([0-9]+).([0-9]+).([0-9]+)?', api.get_product_info().full_version).groups()
|
||||||
|
if version[0] == '3' and version[1] == '5' and (version[2] is None or version[2] < '4'): # 3.5 fails if disks are in request
|
||||||
|
return [False, 'Version 3.5 is not fully supported due a BUG in oVirt REST API (but partially supported. See UDS Documentation)']
|
||||||
|
|
||||||
|
return [True, 'Test successfully passed']
|
||||||
|
|
||||||
|
|
||||||
def isFullyFunctionalVersion(self):
|
def isFullyFunctionalVersion(self):
|
||||||
try:
|
try:
|
||||||
lock.acquire(True)
|
lock.acquire(True)
|
||||||
version = self.__getApi().get_product_info().version
|
return self._isFullyFunctionalVersion(self.__getApi())
|
||||||
if version.major == 3 and version.minor == 5: # 3.5 fails if disks are in request
|
|
||||||
return [False, 'Version 3.5 is not fully supported due a BUG in oVirt REST API (but partially supported. See UDS Documentation)']
|
|
||||||
finally:
|
finally:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
return [True, 'Test successfully passed']
|
|
||||||
|
|
||||||
def getVms(self, force=False):
|
def getVms(self, force=False):
|
||||||
'''
|
'''
|
||||||
Obtains the list of machines inside ovirt that do aren't part of uds
|
Obtains the list of machines inside ovirt that do aren't part of uds
|
||||||
@ -378,8 +386,9 @@ class Client(object):
|
|||||||
# Create disks description to be created in specified storage domain, one for each disk
|
# Create disks description to be created in specified storage domain, one for each disk
|
||||||
sd = params.StorageDomains(storage_domain=[params.StorageDomain(id=storageId)])
|
sd = params.StorageDomains(storage_domain=[params.StorageDomain(id=storageId)])
|
||||||
|
|
||||||
version = api.get_product_info().version
|
fix = not self._isFullyFunctionalVersion(api)[0] # If we need a fix for "publish"
|
||||||
fix = version.major == 3 and version.minor == 5 # 3.5 fails if disks are in request
|
|
||||||
|
print "FIX: {}".format(fix)
|
||||||
|
|
||||||
dsks = []
|
dsks = []
|
||||||
for dsk in vm.disks.list():
|
for dsk in vm.disks.list():
|
||||||
@ -407,8 +416,6 @@ class Client(object):
|
|||||||
# display=display)
|
# display=display)
|
||||||
|
|
||||||
return api.templates.add(template).get_id()
|
return api.templates.add(template).get_id()
|
||||||
|
|
||||||
# return api.templates.get(name=name).get_id()
|
|
||||||
finally:
|
finally:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user