Fix lint
diff --git a/.hadolint.yaml b/.hadolint.yaml
new file mode 100644
index 0000000..ef55db3
--- /dev/null
+++ b/.hadolint.yaml
@@ -0,0 +1,2 @@
+ignored:
+ - DL3020
diff --git a/staffeln/common/lock.py b/staffeln/common/lock.py
index 88772ab..244fa72 100644
--- a/staffeln/common/lock.py
+++ b/staffeln/common/lock.py
@@ -6,8 +6,8 @@
import uuid
from typing import Optional # noqa: H301
-from oslo_log import log
import sherlock
+from oslo_log import log
from staffeln import conf, exception
from tooz import coordination
@@ -16,9 +16,8 @@
class LockManager(object):
- def __init__(self, lock_backend="k8s"):
- self.coordinator = COORDINATOR if (
- lock_backend == "tooz") else K8SCOORDINATOR
+ def __init__(self, backend="k8s"):
+ self.coordinator = COORDINATOR if backend == "tooz" else K8SCOORDINATOR
def __enter__(self):
self.coordinator.start()
@@ -133,6 +132,7 @@
except Exception as exc:
_err(file_name, exc)
+
class K8sCoordinator(object):
"""Sherlock kubernetes coordination wrapper.
@@ -141,8 +141,9 @@
:param str namespace: Set lock namespace.
"""
- def __init__(self, expire: int = 3600, timeout: int = 10,
- namespace: str = "staffeln"):
+ def __init__(
+ self, expire: int = 3600, timeout: int = 10, namespace: str = "staffeln"
+ ):
self.timeout = timeout
self.expire = expire
self.namespace = namespace