As the error tells you, Deadline passes two arguments to the function, but you expect none, so it fails.
It sounds a bit counter-intuitive, as you could think “but I am asking for no arguments, why is it telling me about two of them?” It is because the function is invoked by Deadline which passes the two arguments, and catches an error because your function’s arguments list (0 expected) and the actual argument list passed by Deadline misalign.
Here is the documentation of Job Scripts
Note that different types of scripts are called with different parameter lists. For example a Job Script (one executed in place of rendering) only gets the DeadlinePlugin as argument. A Dependency Script expects two - the JobID and TaskIDs. In your case, a Post Job script gets the Deadline Plugin, and the type of the script (“post job”) as argument.
I submitted this simple script as Post Job script:
def __main__( *args ):
print (args[0])
print (args[1])
True
The result in the Post Job’s Log was:
2020-12-21 10:49:49: 0: INFO: Executing post job script 'C:\Users\bobop\Documents\3dsMax\scripts\postjobtest.py'
2020-12-21 10:49:49: 0: PYTHON: Deadline.Plugins.DeadlinePlugin
2020-12-21 10:49:49: 0: PYTHON: post job
2020-12-21 10:49:49: 0: Done executing plugin command of type 'Execute Script'
So you can use the first argument to access the DeadlinePlugin, and the second argument to reason about the type of the script (pre job, post job, pre task, post task)…
For the fun of it, I assigned the same script above as all 4 types of scripts, and as expected I got the following output in the various logs:
Pre-Job Script Log:
2020-12-21 10:57:00: 0: INFO: Executing pre job script 'C:\Users\bobop\Documents\3dsMax\scripts\postjobtest.py'
2020-12-21 10:57:00: 0: PYTHON: Deadline.Plugins.DeadlinePlugin
2020-12-21 10:57:00: 0: PYTHON: pre job
Task 0 Log:
...
2020-12-21 10:58:14: 0: Done executing plugin command of type 'Start Job'
2020-12-21 10:58:14: 0: Plugin rendering frame(s): 0
2020-12-21 10:58:14: 0: Executing plugin command of type 'Render Task'
2020-12-21 10:58:14: 0: INFO: Executing pre task script 'C:\Users\bobop\Documents\3dsMax\scripts\postjobtest.py'
2020-12-21 10:58:14: 0: PYTHON: Deadline.Plugins.DeadlinePlugin
2020-12-21 10:58:14: 0: PYTHON: pre task
...
2020-12-21 10:58:15: 0: INFO: Executing post task script 'C:\Users\bobop\Documents\3dsMax\scripts\postjobtest.py'
2020-12-21 10:58:15: 0: PYTHON: Deadline.Plugins.DeadlinePlugin
2020-12-21 10:58:15: 0: PYTHON: post task
2020-12-21 10:58:15: 0: Done executing plugin command of type 'Render Task'
Job-Post Script (we saw this already)
2020-12-21 10:58:31: 0: INFO: Executing post job script 'C:\Users\bobop\Documents\3dsMax\scripts\postjobtest.py'
2020-12-21 10:58:31: 0: PYTHON: Deadline.Plugins.DeadlinePlugin
2020-12-21 10:58:31: 0: PYTHON: post job
2020-12-21 10:58:31: 0: Done executing plugin command of type 'Execute Script'