diff --git a/server/src/uds/services/PhysicalMachines/service_multi.py b/server/src/uds/services/PhysicalMachines/service_multi.py index 71b8a1bd9..dc2e68d4c 100644 --- a/server/src/uds/services/PhysicalMachines/service_multi.py +++ b/server/src/uds/services/PhysicalMachines/service_multi.py @@ -129,6 +129,10 @@ class IPMachinesService(services.Service): type_description = _('This service provides access to POWERED-ON Machines by IP') icon_file = 'machines.png' + # Override the counting type to conservative on Fixed Services by default, that + # is the desired behaviour for fixed services + overrided_fields = {'max_services_count_type': types.services.ServicesCountingType.CONSERVATIVE} + uses_cache = False # Cache are running machine awaiting to be assigned uses_cache_l2 = False # L2 Cache are running machines in suspended state needs_osmanager = False # If the service needs a s.o. manager (managers are related to agents provided by services itselfs, i.e. virtual machines with agent) diff --git a/server/src/uds/services/PhysicalMachines/service_single.py b/server/src/uds/services/PhysicalMachines/service_single.py index 9a047dfdd..1c248b84e 100644 --- a/server/src/uds/services/PhysicalMachines/service_single.py +++ b/server/src/uds/services/PhysicalMachines/service_single.py @@ -63,6 +63,9 @@ class IPSingleMachineService(services.Service): user_service_type = IPMachineUserService services_type_provided = types.services.ServiceType.VDI + + # Does not really mind. But do not show the field on admin form + overrided_fields = {'max_services_count_type': types.services.ServicesCountingType.STANDARD} # Gui host = gui.TextField( diff --git a/server/src/uds/transports/X2GO/scripts/authorize.py b/server/src/uds/transports/X2GO/scripts/authorize.py index d5e316285..0c891e622 100644 --- a/server/src/uds/transports/X2GO/scripts/authorize.py +++ b/server/src/uds/transports/X2GO/scripts/authorize.py @@ -7,10 +7,11 @@ import os import errno import pwd + def log_error(err, username: str = None): with open('/tmp/uds-x2go-error-{}.log'.format(username or None), 'a') as f: f.write(err) - + print(err) @@ -21,7 +22,9 @@ def update_authorized_keys(username, public_key): return user_info = pwd.getpwnam(username) - user_info. + if user_info is None: + log_error('User {} not found'.format(username)) + return # Create .ssh on user home home = user_info.pw_dir.rstrip('/') @@ -51,12 +54,7 @@ def update_authorized_keys(username, public_key): lines = [] with open(authorized_keys, 'w') as f: - f.writelines( - filter( - lambda x: 'UDS@X2GOCLIENT' not in x and x.strip(), - lines - ) - ) + f.writelines(filter(lambda x: 'UDS@X2GOCLIENT' not in x and x.strip(), lines)) # Append pubkey f.write('ssh-rsa {} UDS@X2GOCLIENT\n'.format(public_key)) @@ -67,6 +65,6 @@ def update_authorized_keys(username, public_key): # Done -# __USER__ and __KEY__ will be replaced by the real values, +# __USER__ and __KEY__ will be replaced by the real values, # # they are placeholders for the real values so keep them. update_authorized_keys('__USER__', '__KEY__')