mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-18 06:03:54 +03:00
* Fixed typo on nx remote script
* Added overrided_fields to neded places
This commit is contained in:
parent
a165122422
commit
9c70a84977
@ -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)
|
||||
|
@ -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(
|
||||
|
@ -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__')
|
||||
|
Loading…
x
Reference in New Issue
Block a user