Added posibility to modify several OS Manager fields even if it is being used

This commit is contained in:
Adolfo Gómez García 2015-02-16 18:31:16 +01:00
parent 111782dffd
commit e6998cb1f3
8 changed files with 34 additions and 22 deletions

View File

@ -137,7 +137,8 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
currName = operations.getComputerName()
if currName.lower() == name.lower():
currDomain = operations.getDomainName()
if currDomain is not None and currDomain.lower() == domain.lower():
logger.debug('Name: "{}" vs "{}", Domain: "{}" vs "{}"'.format(currName.lower(), name.lower(), currDomain.lower(), domain.lower()))
if currDomain is not None:
logger.info(
'Machine {} is part of domain {}'.format(name, domain))
self.setReady()
@ -164,6 +165,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
self.multiStepJoin(name, domain, ou, account, password)
def preConnect(self, user, protocol):
logger.debug('Pre connect invoked')
if protocol != 'rdp': # If connection is not using rdp, skip adding user
return 'ok'
# Well known SSID for Remote Desktop Users

View File

@ -64,7 +64,7 @@ def getNetworkInfo():
continue
if ip == '' or ip is None:
continue
logger.debug('Net config found: {}=({}, {})'.format(obj.Caption, obj.MACAddress, ip))
# logger.debug('Net config found: {}=({}, {})'.format(obj.Caption, obj.MACAddress, ip))
yield utils.Bunch(name=obj.Caption, mac=obj.MACAddress, ip=ip)
except Exception:
return

View File

@ -77,9 +77,8 @@ class OsManagers(ModelHandler):
if item.deployedServices.count() > 0:
raise RequestError(ugettext('Can\'t delete an OS Manager with services pools associated'))
def checkSave(self, item):
if item.deployedServices.count() > 0 and settings.DEBUG is False:
raise RequestError(ugettext('Can\'t modify an OS Manager with services pools associated'))
def checkSave(self, item): # Right now, always can be saved
pass
# Types related
def enum_types(self):

View File

@ -270,8 +270,8 @@ class Publications(DetailHandler):
Custom method "publish", provided to initiate a publication of a deployed service
:param parent: Parent service pool
'''
logger.debug('Custom "publish" invoked')
parent.publish()
logger.debug('Custom "publish" invoked for {}'.format(parent))
parent.publish() # Can raise exceptions that will be processed on response
return self.success()
def cancel(self, parent, uuid):

View File

@ -40,6 +40,7 @@ from django.db import IntegrityError
from uds.core.ui.UserInterface import gui as uiGui
from uds.REST.handlers import Handler, HandlerError
from uds.core.util import log
import fnmatch
import re
import itertools
@ -49,7 +50,7 @@ import logging
logger = logging.getLogger(__name__)
__updated__ = '2015-02-10'
__updated__ = '2015-02-16'
# a few constants
@ -293,15 +294,12 @@ class DetailHandler(BaseModelHandler): # pylint: disable=abstract-class-not-use
'''
logger.debug('Checking custom method {0}'.format(check))
if check in self.custom_methods:
try:
operation = getattr(self, check)
operation = getattr(self, check)
if arg is None:
return operation(parent)
else:
return operation(parent, arg)
except Exception:
self.invalidMethodException()
if arg is None:
return operation(parent)
else:
return operation(parent, arg)
return None

View File

@ -55,7 +55,7 @@ class LinuxOsManager(osmanagers.OSManager):
onLogout = gui.ChoiceField(
label=_('On Logout'),
order=10,
rdonly=False,
rdonly=True,
tooltip=_('What to do when user logs out from service'),
values=[
{'id': 'keep', 'text': _('Keep service assigned')},
@ -63,8 +63,13 @@ class LinuxOsManager(osmanagers.OSManager):
],
defvalue='keep')
idle = gui.NumericField(label=_("Max.Idle time"), length=4, defvalue=-1, rdonly=False, order=11,
tooltip=_('Maximum idle time (in seconds) before session is automaticatlly closed to the user (<= 0 means no max idle time).'), required=True)
idle = gui.NumericField(
label=_("Max.Idle time"),
length=4,
defvalue=-1,
rdonly=False, order=11,
tooltip=_('Maximum idle time (in seconds) before session is automaticatlly closed to the user (<= 0 means no max idle time).'),
required=True)
def __setProcessUnusedMachines(self):
self.processUnusedMachines = self._onLogout == 'remove'

View File

@ -47,7 +47,7 @@ class WindowsOsManager(osmanagers.OSManager):
onLogout = gui.ChoiceField(
label=_('On Logout'),
order=10,
rdonly=False,
rdonly=True,
tooltip=_('What to do when user logs out from service'),
values=[
{'id': 'keep', 'text': _('Keep service assigned')},
@ -56,8 +56,15 @@ class WindowsOsManager(osmanagers.OSManager):
defvalue='keep'
)
idle = gui.NumericField(label=_("Max.Idle time"), length=4, defvalue=-1, rdonly=False, order=11,
tooltip=_('Maximum idle time (in seconds) before session is automaticatlly closed to the user (<= 0 means no max. idle time)'), required=True)
idle = gui.NumericField(
label=_("Max.Idle time"),
length=4,
defvalue=-1,
rdonly=False,
order=11,
tooltip=_('Maximum idle time (in seconds) before session is automaticatlly closed to the user (<= 0 means no max. idle time)'),
required=True
)
@staticmethod
def validateLen(length):

View File

@ -1 +1,2 @@
/bin/
/jar/