From 0ba8e83588d595a5e7158c398b1b708a4d495728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 11 Aug 2020 12:33:40 +0200 Subject: [PATCH] Removed memory for now from proxmox. Not really used --- actor/src/udsactor/http/clients_pool.py | 2 +- .../uds/services/Proxmox/client/__init__.py | 3 +-- server/src/uds/services/Proxmox/provider.py | 5 ++--- server/src/uds/services/Proxmox/service.py | 19 +++---------------- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/actor/src/udsactor/http/clients_pool.py b/actor/src/udsactor/http/clients_pool.py index e554e23b..ae94c494 100644 --- a/actor/src/udsactor/http/clients_pool.py +++ b/actor/src/udsactor/http/clients_pool.py @@ -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 diff --git a/server/src/uds/services/Proxmox/client/__init__.py b/server/src/uds/services/Proxmox/client/__init__.py index f1bbe52d..aa3b1073 100644 --- a/server/src/uds/services/Proxmox/client/__init__.py +++ b/server/src/uds/services/Proxmox/client/__init__.py @@ -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) diff --git a/server/src/uds/services/Proxmox/provider.py b/server/src/uds/services/Proxmox/provider.py index e37845c9..b906fcf0 100644 --- a/server/src/uds/services/Proxmox/provider.py +++ b/server/src/uds/services/Proxmox/provider.py @@ -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) diff --git a/server/src/uds/services/Proxmox/service.py b/server/src/uds/services/Proxmox/service.py index 6256a044..3751af69 100644 --- a/server/src/uds/services/Proxmox/service.py +++ b/server/src/uds/services/Proxmox/service.py @@ -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':