diff options
author | RĂ©mi Duraffort <remi.duraffort@linaro.org> | 2018-04-03 11:03:38 +0200 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-04-25 09:31:22 +0100 |
commit | 2e84699d8e5c28f33c81fc102eb72f8b2cd3aecb (patch) | |
tree | a20b38486c8b8fd27330241299579c5d2f13a8ee /lava_dispatcher/shell.py | |
parent | e3b0974709cde794a279280b6287ce82f9080ac2 (diff) |
Port classes to python3 only
Change-Id: I8bc55876f82817533dfef42128aefea15c904311
Diffstat (limited to 'lava_dispatcher/shell.py')
-rw-r--r-- | lava_dispatcher/shell.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lava_dispatcher/shell.py b/lava_dispatcher/shell.py index 1dac3ef50..da06d0b74 100644 --- a/lava_dispatcher/shell.py +++ b/lava_dispatcher/shell.py @@ -124,7 +124,7 @@ class ShellCommand(pexpect.spawn): # pylint: disable=too-many-public-methods def sendcontrol(self, char): self.logger.input(char) - return super(ShellCommand, self).sendcontrol(char) + return super().sendcontrol(char) def send(self, string, delay=0, send_char=True): # pylint: disable=arguments-differ """ @@ -136,10 +136,10 @@ class ShellCommand(pexpect.spawn): # pylint: disable=too-many-public-methods delay = float(delay) / 1000 if send_char: for char in string: - sent += super(ShellCommand, self).send(char) + sent += super().send(char) time.sleep(delay) else: - sent = super(ShellCommand, self).send(string) + sent = super().send(string) return sent def expect(self, *args, **kw): @@ -148,7 +148,7 @@ class ShellCommand(pexpect.spawn): # pylint: disable=too-many-public-methods the TestShellAction make much more useful reports of what was matched """ try: - proc = super(ShellCommand, self).expect(*args, **kw) + proc = super().expect(*args, **kw) except pexpect.TIMEOUT: raise TestError("ShellCommand command timed out.") except ValueError as exc: @@ -173,7 +173,7 @@ class ShellSession(Connection): Optionally, a prompt can be forced after a percentage of the timeout. """ - super(ShellSession, self).__init__(job, shell_command) + super().__init__(job, shell_command) self.name = "ShellSession" # FIXME: rename __prompt_str__ to indicate it can be a list or str self.__prompt_str__ = None @@ -184,7 +184,7 @@ class ShellSession(Connection): def disconnect(self, reason=''): logger = logging.getLogger('dispatcher') logger.debug("Disconnecting %s", self.name) - super(ShellSession, self).disconnect(reason) + super().disconnect(reason) # FIXME: rename prompt_str to indicate it can be a list or str @property @@ -294,16 +294,16 @@ class ExpectShellSession(Action): summary = "Expect a shell prompt" def __init__(self): - super(ExpectShellSession, self).__init__() + super().__init__() self.force_prompt = True def validate(self): - super(ExpectShellSession, self).validate() + super().validate() if 'prompts' not in self.parameters: self.errors = "Unable to identify test image prompts from parameters." def run(self, connection, max_end_time, args=None): - connection = super(ExpectShellSession, self).run(connection, max_end_time, args) + connection = super().run(connection, max_end_time, args) if not connection: raise JobError("No connection available.") if not connection.prompt_str: |