diff options
author | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-11-27 16:53:52 +0000 |
---|---|---|
committer | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-11-27 16:53:52 +0000 |
commit | dfed68943468c349b24fc928ff5c4b533c829fbe (patch) | |
tree | a8898e21b7d9589695c7753a76ea77661c4855f4 | |
parent | f48426d52581a064282bdbc3f7920dfda4b3739d (diff) | |
download | sos-dfed68943468c349b24fc928ff5c4b533c829fbe.tar.gz |
[worker] Slightly simplified shell API and init
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1034 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r-- | worker/worker.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/worker/worker.py b/worker/worker.py index 335bcbf8..812eb4cb 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -75,18 +75,12 @@ class ExecRequest(Request): self.shell.write_blob(stderr) class Shell: - def __init__(self, - input_stream = None, - output_stream = None, - status_stream = None, - bork_action = None): + def __init__(self, input_stream, output_stream, status_stream, + bork_action = None): self.__input_stream__ = input_stream self.__output_stream__ = output_stream self.__status_stream__ = status_stream - if bork_action: - self.__bork_action__ = bork_action - else: - self.__bork_action__ = self.exit + self.__bork_action__ = bork_action or self.exit self.__exit__ = False self.__cmd_number__ = 0 @@ -153,7 +147,4 @@ if __name__ == "__main__": signal(SIGUSR1, handler) def bork(): exit(-1) - Shell(input_stream = stdin, - output_stream = stdout, - status_stream = stderr, - bork_action = bork).loop() + Shell(stdin, stdout, stderr, bork_action = bork).loop() |