Hello there
Running Deadline 7.1.2.1 (having most difficulties syncing work with the Linux team there so we can upgrade)
I’m having a lack of responde of both
RepositoryUtils.AddSlavesToLimitGroupList()
RepositoryUtils.RemoveSlavesFromLimitGroupList()
functions
The script is applied at OnSlaveStartedCallback event to include slaves in correct limit groups depending on which OS they are running (and we change default OS a lot depending on needs)
All other parts of the script run fine so I guess something is wrong in what I want to do, or in the way I write the function
Provided are the full script and a job log from a slave
Any idea welcome
This is the basis but it is also meant to add slaves to plugin/software based limitgroups
Script:
[code]
###############################################################
Imports
###############################################################
from Deadline.Events import *
from Deadline.Scripting import *
def GetDeadlineEventListener():
‘’’ Return an instance of the event listener ‘’’
return PluginListener()
def CleanupDeadlineEventListener(eventListener):
‘’’ Free items set by Python as they can leak with Python.net ‘’’
eventListener.Cleanup()
###############################################################
The event listener class.
###############################################################
class PluginListener (DeadlineEventListener):
def init(self):
self.OnSlaveStartedCallback += self.OnSlaveStarted
def Cleanup(self):
del self.OnSlaveStartedCallback
# This is called every time the Slave starts
def OnSlaveStarted(self, slavename):
print 'Slave-Setup.py started'
slaveSettings = RepositoryUtils.GetSlaveSettings(slavename, True)
slaveInfo = RepositoryUtils.GetSlaveInfo(slavename, True)
if any ('windows' in s.lower() for s in slaveInfo.MachineOperatingSystem.split( )):
print 'Windows running'
slaveSettings.SlaveExtraInfo9 = 'Windows'
RepositoryUtils.AddSlavesToLimitGroupList('_windows',slavename)
RepositoryUtils.RemoveSlavesFromLimitGroupList('_linux',slavename)
else:
print 'Linux running'
slaveSettings.SlaveExtraInfo9 = 'Linux'
RepositoryUtils.AddSlavesToLimitGroupList('_linux',slavename)
RepositoryUtils.RemoveSlavesFromLimitGroupList('_windows',slavename)
RepositoryUtils.SaveSlaveSettings(slaveSettings)
print 'Slave-Setup.py completed'[/code]
Log:
=======================================================
Log
=======================================================
2016-02-24 10:15:25: BEGIN - WS040\jerome.du
2016-02-24 10:15:25: PYTHON: Slave-Setup.py started
2016-02-24 10:15:25: PYTHON: Windows running
2016-02-24 10:15:25: PYTHON: Slave-Setup.py completed
=======================================================
Details
=======================================================
Date: 02/24/2016 10:15:25
Event Type: OnSlaveStarted
=======================================================
Slave Information
=======================================================
Slave Name: ws040
Version: v7.1.2.1 R (53013d5bd)
Operating System: Windows 10 Pro
Running As Service: No
Machine User: jerome.du
IP Address: 10.200.31.25
MAC Address: 00:22:64:32:1F:12
CPU Architecture: x64
CPUs: 8
CPU Usage:
Memory Usage:
Free Disk Space:
Video Card: NVIDIA Quadro FX 3800