An unexpected error occurred while Saving Event Plugin Settings:
The given key was not present in the dictionary. (Deadline.Plugins.PluginException)
at Deadline.Events.SandboxedEventManager.a(DeadlineMessage A_0)
at Deadline.Events.SandboxedEventManager.CheckForUpdates()
at Deadline.Monitor.WorkItems.SaveEventPluginSettingsWI.InternalDoWork()
at Deadline.Monitor.MonitorWorkItem.DoWork()
Got this error when enabling the event plugin.
[code][State]
Type=Enum
Items=Global Enabled;Opt-In;Disabled
Label=State
Default=Disabled
Description=How this event plug-in should respond to events. If Global, all jobs and slaves will trigger the events for this plugin. If Opt-In, jobs and slaves can choose to trigger the events for this plugin. If Disabled, no events are triggered for this plugin.
[RenderPool]
Type=string
Category=Options
CategoryOrder=0
Index=1
Label=Draft Pool
Default=
Description=The Pool to which Slaves will be added automatically.
[RenderGroup]
Type=string
Category=Options
CategoryOrder=0
Index=2
Label=Draft Group
Default=
Description=The Group to which Slaves will be added automatically.
[/code]
[code]
###############################################################
Imports
###############################################################
from System.Diagnostics import *
from System.IO import *
from System import TimeSpan
from Deadline.Events import *
from Deadline.Scripting import *
import re, sys, os, subprocess, traceback, shlex
###############################################################
This is the function called by Deadline to get an instance of the Draft event listener.
###############################################################
def GetDeadlineEventListener():
return ConfigSlaveEventListener()
def CleanupDeadlineEventListener( eventListener ):
eventListener.Cleanup()
###############################################################
The Draft event listener class.
###############################################################
class ConfigSlaveEventListener (DeadlineEventListener):
def init( self ):
self.OnSlaveStartedCallback += self.OnSlaveStarted
def Cleanup( self ):
del self.OnSlaveStartedCallback
## This is called when the job finishes rendering.
def OnSlaveStarted( self, slavename ):
try:
slaveSettings = RepositoryUtils.GetSlaveSettings(slavename, True)
if slavename.lower()[0:10] == "render-vm-":
remotehost="render-" + slavename[-2:] + "-host"
cmd="getmac /S " + remotehost + " /NH"
p=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
output, errors = p.communicate()
if output is not None :
if output != "":
item = output.split("\n")[1].split(" ")[0]
slaveSettings.SlaveMacAddressOverride = item
RepositoryUtils.SaveSlaveSettings(slaveSettings)
RepositoryUtils.AddPoolToSlave(slavename, "urgent")
RepositoryUtils.AddPoolToSlave(slavename, "global")
RepositoryUtils.AddGroupToSlave(slavename, "global")
RepositoryUtils.AddGroupToSlave(slavename, "i7_v01")
RepositoryUtils.AddGroupToSlave(slavename, "rendernodes")
pmanage = RepositoryUtils.GetPowerManagementOptions()
pmanage.Groups[0].SlaveNames.Add(slavename)
except:
ClientUtils.LogText( traceback.format_exc() )[/code]