Cleanup: use super() instead of super(__class__, self) (#11016)

* Address UP008: Use super() instead of super(__class__, self).

* Linting.
This commit is contained in:
Felix Fontein
2025-10-30 20:17:26 +01:00
committed by GitHub
parent 0c5466de47
commit 74c2c804e5
204 changed files with 390 additions and 401 deletions

View File

@@ -99,7 +99,7 @@ class Connection(ConnectionBase):
default_user = 'root'
def __init__(self, play_context, new_stdin, *args, **kwargs):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
super().__init__(play_context, new_stdin, *args, **kwargs)
self.chroot = self._play_context.remote_addr
@@ -130,7 +130,7 @@ class Connection(ConnectionBase):
except ValueError as e:
raise AnsibleError(str(e))
super(Connection, self)._connect()
super()._connect()
if not self._connected:
display.vvv("THIS IS A LOCAL CHROOT DIR", host=self.chroot)
self._connected = True
@@ -155,7 +155,7 @@ class Connection(ConnectionBase):
def exec_command(self, cmd, in_data=None, sudoable=False):
""" run a command on the chroot """
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
super().exec_command(cmd, in_data=in_data, sudoable=sudoable)
p = self._buffered_exec_command(cmd)
@@ -179,7 +179,7 @@ class Connection(ConnectionBase):
def put_file(self, in_path, out_path):
""" transfer a file from local to chroot """
super(Connection, self).put_file(in_path, out_path)
super().put_file(in_path, out_path)
display.vvv(f"PUT {in_path} TO {out_path}", host=self.chroot)
out_path = shlex_quote(self._prefix_login_path(out_path))
@@ -205,7 +205,7 @@ class Connection(ConnectionBase):
def fetch_file(self, in_path, out_path):
""" fetch a file from chroot to local """
super(Connection, self).fetch_file(in_path, out_path)
super().fetch_file(in_path, out_path)
display.vvv(f"FETCH {in_path} TO {out_path}", host=self.chroot)
in_path = shlex_quote(self._prefix_login_path(in_path))
@@ -229,5 +229,5 @@ class Connection(ConnectionBase):
def close(self):
""" terminate the connection; nothing to do here """
super(Connection, self).close()
super().close()
self._connected = False