Skip to content

Commit 5e77a00

Browse files
committed
Linting.
1 parent 230922b commit 5e77a00

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

plugins/module_utils/_api/context/__init__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

plugins/module_utils/_api/context/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def contexts(cls):
129129
names.append(data["Name"])
130130
except Exception as e:
131131
raise errors.ContextException(
132-
f"Failed to load metafile {filepath}: {e}",
132+
"Failed to load metafile {filepath}: {e}".format(filepath=filepath, e=e),
133133
) from e
134134

135135
contexts = [cls.DEFAULT_CONTEXT]

plugins/module_utils/_api/context/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, name, orchestrator=None, host=None, endpoints=None,
5959
if not isinstance(v, dict):
6060
# unknown format
6161
raise ContextException(
62-
f"Unknown endpoint format for context {name}: {v}",
62+
"Unknown endpoint format for context {name}: {v}".format(name=name, v=v),
6363
)
6464

6565
self.endpoints[k] = v
@@ -114,7 +114,7 @@ def _load_meta(cls, name):
114114
except (OSError, KeyError, ValueError) as e:
115115
# unknown format
116116
raise Exception(
117-
f"Detected corrupted meta file for context {name} : {e}"
117+
"Detected corrupted meta file for context {name} : {e}".format(name=name, e=e)
118118
) from e
119119

120120
# for docker endpoints, set defaults for
@@ -189,7 +189,7 @@ def remove(self):
189189
rmtree(self.tls_path)
190190

191191
def __repr__(self):
192-
return f"<{self.__class__.__name__}: '{self.name}'>"
192+
return "<{classname}: '{name}'>".format(classname=self.__class__.__name__, name=self.name)
193193

194194
def __str__(self):
195195
return json.dumps(self.__call__(), indent=2)

tests/unit/plugins/module_utils/_api/test_context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
DEFAULT_UNIX_SOCKET,
2121
IS_WINDOWS_PLATFORM,
2222
)
23-
from ansible_collections.community.docker.plugins.module_utils._api.context import Context, ContextAPI
23+
from ansible_collections.community.docker.plugins.module_utils._api.context.api import ContextAPI
24+
from ansible_collections.community.docker.plugins.module_utils._api.context.context import Context
2425

2526

2627
class BaseContextTest(unittest.TestCase):

0 commit comments

Comments
 (0)