1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-23 17:34:17 +03:00

Removed memory for now from proxmox. Not really used

This commit is contained in:
Adolfo Gómez García 2020-08-11 12:33:40 +02:00
parent e58b3e52e9
commit 0ba8e83588
4 changed files with 7 additions and 22 deletions

View File

@ -50,7 +50,7 @@ class UDSActorClientPool:
result.append(requests.post(clientUrl + '/' + method, data=json.dumps(data), verify=False, timeout=timeout))
except Exception as e:
# If cannot request to a clientUrl, remove it from list
logger.info('Could not coneect with client %s: %s. Removed from registry.', e, clientUrl)
logger.info('Could not connect with client %s: %s. Removed from registry.', e, clientUrl)
removables.append(clientUrl)
# Remove failed connections

View File

@ -235,8 +235,7 @@ class ProxmoxClient:
linkedClone: bool,
toNode: typing.Optional[str] = None,
toStorage: typing.Optional[str] = None,
toPool: typing.Optional[str] = None,
memory: int = 0
toPool: typing.Optional[str] = None
) -> types.VmCreationResult:
newVmId = self.getNextVMId()
vmInfo = self.getVmInfo(vmId)

View File

@ -133,10 +133,9 @@ class ProxmoxProvider(services.ServiceProvider): # pylint: disable=too-many-pub
linkedClone: bool,
toNode: typing.Optional[str] = None,
toStorage: typing.Optional[str] = None,
toPool: typing.Optional[str] = None,
memory: int = 0
toPool: typing.Optional[str] = None
) -> client.types.VmCreationResult:
return self.__getApi().cloneVm(vmId, name, description, linkedClone, toNode, toStorage, toPool, memory)
return self.__getApi().cloneVm(vmId, name, description, linkedClone, toNode, toStorage, toPool)
def startMachine(self,vmId: int) -> client.types.UPID:
return self.__getApi().startVm(vmId)

View File

@ -144,18 +144,6 @@ class ProxmoxLinkedService(Service): # pylint: disable=too-many-public-methods
required=True
)
memory = gui.NumericField(
label=_("Memory (Mb)"),
length=4,
defvalue=512,
minValue=0,
rdonly=False,
order=112,
tooltip=_('Memory assigned to machines'),
tab=_('Machine'),
required=True
)
baseName = gui.TextField(
label=_('Machine Names'),
rdonly=False,
@ -181,8 +169,8 @@ class ProxmoxLinkedService(Service): # pylint: disable=too-many-public-methods
def initialize(self, values: 'Module.ValuesType') -> None:
if values:
self.baseName.value = validators.validateHostname(self.baseName.value, 15, asPattern=True)
if int(self.memory.value) < 128:
raise Service.ValidationException(_('The minimum allowed memory is 128 Mb'))
# if int(self.memory.value) < 128:
# raise Service.ValidationException(_('The minimum allowed memory is 128 Mb'))
def initGui(self) -> None:
# Here we have to use "default values", cause values aren't used at form initialization
@ -235,8 +223,7 @@ class ProxmoxLinkedService(Service): # pylint: disable=too-many-public-methods
description,
linkedClone=True,
toStorage=self.datastore.value,
toPool=pool,
memory=self.memory.num()*1024*1024
toPool=pool
)
def getMachineInfo(self, vmId: int) -> 'client.types.VMInfo':