mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Python code modernization, 3/n (#1157)
* Remove __metaclass__ = type. for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do sed -e '/^__metaclass__ = type/d' -i $i; done * Remove super arguments, and stop inheriting from object.
This commit is contained in:
@@ -7,10 +7,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible.errors import AnsibleConnectionFailure
|
||||
from ansible.utils.display import Display
|
||||
from ansible_collections.community.docker.plugins.module_utils._common import (
|
||||
@@ -25,7 +21,7 @@ class AnsibleDockerClient(AnsibleDockerClientBase):
|
||||
def __init__(self, plugin, min_docker_version=None, min_docker_api_version=None):
|
||||
self.plugin = plugin
|
||||
self.display = Display()
|
||||
super(AnsibleDockerClient, self).__init__(
|
||||
super().__init__(
|
||||
min_docker_version=min_docker_version,
|
||||
min_docker_api_version=min_docker_api_version,
|
||||
)
|
||||
|
||||
@@ -21,9 +21,7 @@ class AnsibleDockerClient(AnsibleDockerClientBase):
|
||||
def __init__(self, plugin, min_docker_api_version=None):
|
||||
self.plugin = plugin
|
||||
self.display = Display()
|
||||
super(AnsibleDockerClient, self).__init__(
|
||||
min_docker_api_version=min_docker_api_version
|
||||
)
|
||||
super().__init__(min_docker_api_version=min_docker_api_version)
|
||||
|
||||
def fail(self, msg, **kwargs):
|
||||
if kwargs:
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import selectors
|
||||
|
||||
from ansible_collections.community.docker.plugins.module_utils._socket_handler import (
|
||||
@@ -20,6 +16,6 @@ from ansible_collections.community.docker.plugins.module_utils._socket_handler i
|
||||
|
||||
class DockerSocketHandler(DockerSocketHandlerBase):
|
||||
def __init__(self, display, sock, log=None, container=None):
|
||||
super(DockerSocketHandler, self).__init__(
|
||||
super().__init__(
|
||||
sock, selectors, log=lambda msg: display.vvvv(msg, host=container)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user