after upgrading to 10.3.0.10 from 10.1.23.6 my custom events don’t load throwing following error in the monitor console
2023-08-31 00:28:31: Detected new event plugin DisableMaxPopupHandlingEvent in the Repository, it will now be initialized
2023-08-31 00:28:31: Event plugin 'DisableMaxPopupHandlingEvent' could not be loaded from the repository because: Error executing event plugin script "\\path\to\event.py": name 'DeadlineEventListener' is not defined (Deadline.Events.DeadlineEventPluginException)
I’m aware that I now need to call super().init() in the listeners __init() and even copied to example code into one of them (replacing occurances of ‘MyEvent’ with the event’s name), which didn’t help either.
Creating a new dummy event ‘MyEvent’ from the example does seem to initialize fine though.
Any pointers?
I’d really appreciate such mandatory changes that affect every custom event/plugin to be communicated in the release history even though it might already be documented deep in the python upgrade guide.
EDIT: Once enabled even the “dummy event” will throw that error.
That’s really odd - I’ve just fired up a copy of that sample event and had the same issue. But all my other custom scripts I updated to 10.3 just needed the super.__init__() call to get back in action.
Looks like the from Deadline.Events import * is no longer good enough to use DeadlineEventListener without any qualifiers.
If you change:
from Deadline.Events import *
to
from Deadline.Events import DeadlineEventListener
you’ll be back running based on my tests.
I’ll get rolling on an update to the Python upgrade docs to both make the updates of older scripts easier to find. And brushing up on my Py2->Py3 import differences so any other issues jump out at me.
I ran into this today (just upgraded to DL 10.3.0.13 – from 10.1.23). In case googling brings you here, my error was: Event Error (OnJobSubmitted): name 'RepositoryUtils' is not defined
In addition to DeadlineEventListener, I also had to change this:
from: from Deadline.Scripting import *
to from Deadline.Scripting import RepositoryUtils