Fixed a regression in cmdhandler that made systemcommands fail.

This commit is contained in:
Griatch 2015-02-15 09:47:19 +01:00
parent a24b79bb97
commit 27388d3dd1
2 changed files with 4 additions and 3 deletions

View file

@ -277,7 +277,7 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
""" """
@inlineCallbacks @inlineCallbacks
def _run_command(cmd, args): def _run_command(cmd, cmdname, args):
""" """
This initializes and runs the Command instance once the parser This initializes and runs the Command instance once the parser
has identified it as either a normal command or one of the has identified it as either a normal command or one of the
@ -285,6 +285,7 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
Args: Args:
cmd (Command): command object cmd (Command): command object
cmdname (str): name of command
args (str): extra text entered after the identified command args (str): extra text entered after the identified command
Returns: Returns:
deferred (Deferred): this will fire when the func() method deferred (Deferred): this will fire when the func() method
@ -438,7 +439,7 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
raise ExecSystemCommand(cmd, sysarg) raise ExecSystemCommand(cmd, sysarg)
# A normal command. # A normal command.
ret = yield _run_command(cmd, args) ret = yield _run_command(cmd, cmdname, args)
returnValue(ret) returnValue(ret)
except ExecSystemCommand, exc: except ExecSystemCommand, exc:
@ -448,7 +449,7 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
sysarg = exc.sysarg sysarg = exc.sysarg
if syscmd: if syscmd:
ret = yield _run_command(syscmd, sysarg) ret = yield _run_command(syscmd, syscmd.key, sysarg)
returnValue(ret) returnValue(ret)
elif sysarg: elif sysarg:
# return system arg # return system arg