aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-04-09 19:39:24 +0000
committerGitHub <noreply@github.com>2024-04-09 19:39:24 +0000
commitbbdfd970fee8decec8881e17dce651ef5d2c1803 (patch)
treec2f923dd7a78080d861930a418e4abd927dd94f2
parent4a19cb7cd01092b117d08408d073adac38316ad6 (diff)
downloadydb-bbdfd970fee8decec8881e17dce651ef5d2c1803.tar.gz
Fix flake8 in ydbd_slice (#3612)
-rw-r--r--ydb/tools/ydbd_slice/handlers.py9
-rw-r--r--ydb/tools/ydbd_slice/kube/docker.py2
-rw-r--r--ydb/tools/ydbd_slice/kube/dynconfig.py22
-rw-r--r--ydb/tools/ydbd_slice/kube/handlers.py3
-rw-r--r--ydb/tools/ydbd_slice/nodes.py2
5 files changed, 21 insertions, 17 deletions
diff --git a/ydb/tools/ydbd_slice/handlers.py b/ydb/tools/ydbd_slice/handlers.py
index 1ebb0fac52f..a6d89f79655 100644
--- a/ydb/tools/ydbd_slice/handlers.py
+++ b/ydb/tools/ydbd_slice/handlers.py
@@ -287,8 +287,13 @@ def _start_dynamic(components, nodes, cluster_details, walle_provider):
continue
slots_taken.add((slot, node))
if domain.bind_slots_to_numa_nodes and numa_nodes[node] > 0:
- _start_slot_for_tenant(nodes, slot, tenant, host=node,
- node_bind=numa_nodes_counters[node])
+ _start_slot_for_tenant(
+ nodes,
+ slot,
+ tenant,
+ host=node,
+ node_bind=numa_nodes_counters[node]
+ )
numa_nodes_counters[node] += 1
numa_nodes_counters[node] %= numa_nodes[node]
else:
diff --git a/ydb/tools/ydbd_slice/kube/docker.py b/ydb/tools/ydbd_slice/kube/docker.py
index f15182978e6..84bbe2b0492 100644
--- a/ydb/tools/ydbd_slice/kube/docker.py
+++ b/ydb/tools/ydbd_slice/kube/docker.py
@@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
DOCKER_IMAGE_YDBD_PACKAGE_SPEC = 'ydb/tools/ydbd_slice/image/pkg.json'
-DOCKER_IMAGE_KIKIMR_PACKAGE_SPEC = None # it is set up on runtime from arcadia source code
+DOCKER_IMAGE_KIKIMR_PACKAGE_SPEC = None # it is set up on runtime from arcadia source code
DOCKER_IMAGE_REGISTRY = 'cr.yandex'
DOCKER_IMAGE_REPOSITORY = 'crpbo4q9lbgkn85vr1rm'
DOCKER_IMAGE_NAME = 'ydb'
diff --git a/ydb/tools/ydbd_slice/kube/dynconfig.py b/ydb/tools/ydbd_slice/kube/dynconfig.py
index 2946934bd11..164e4a615f1 100644
--- a/ydb/tools/ydbd_slice/kube/dynconfig.py
+++ b/ydb/tools/ydbd_slice/kube/dynconfig.py
@@ -10,7 +10,7 @@ from ydb.draft import DynamicConfigClient
logger = logging.getLogger(__name__)
-DYNCONFIG_NAME= 'dynconfig.yaml'
+DYNCONFIG_NAME = 'dynconfig.yaml'
class Client():
@@ -29,8 +29,8 @@ class Client():
self.driver.wait(timeout=5)
except TimeoutError:
if self.allow_fallback_to_anonymous_credentials:
- logger.warning('Trying to fallback to anonymous credentials. ' \
- 'To get rid of this message either set YDB_ANONYMOUS_CREDENTIALS=1 ' \
+ logger.warning('Trying to fallback to anonymous credentials. '
+ 'To get rid of this message either set YDB_ANONYMOUS_CREDENTIALS=1 '
'Or set correct credentials in env as it described in ydb-python-sdk.')
config = self.config
config.credentials = AnonymousCredentials()
@@ -77,11 +77,11 @@ def get_remote_config(client):
def apply_config(client, project_path, force=False, allow_unknown_fields=True):
- config = get_local_config(project_path)
- if force:
- client.set_config(config, False, allow_unknown_fields)
- else:
- client.replace_config(config, False, allow_unknown_fields)
- # TODO: there is small race here, we can pull back config applied after our's, but for dev slices it's fine
- # as far as even in real production with long approve process we faced conflict only once in a three months
- return get_remote_config(client)
+ config = get_local_config(project_path)
+ if force:
+ client.set_config(config, False, allow_unknown_fields)
+ else:
+ client.replace_config(config, False, allow_unknown_fields)
+ # TODO: there is small race here, we can pull back config applied after our's, but for dev slices it's fine
+ # as far as even in real production with long approve process we faced conflict only once in a three months
+ return get_remote_config(client)
diff --git a/ydb/tools/ydbd_slice/kube/handlers.py b/ydb/tools/ydbd_slice/kube/handlers.py
index d01d9258f86..05080b8b93a 100644
--- a/ydb/tools/ydbd_slice/kube/handlers.py
+++ b/ydb/tools/ydbd_slice/kube/handlers.py
@@ -2,7 +2,6 @@ import re
import os
import sys
import logging
-import time
from collections import defaultdict
from kubernetes.client import Configuration
@@ -263,7 +262,7 @@ def wait_for_storage(api_client, project_path, manifests):
except TimeoutError as e:
sys.exit(e.args[0])
-#
+
# macro level ydb functions
def slice_ydb_apply(api_client, project_path, manifests, dynamic_config_type):
# process storages first
diff --git a/ydb/tools/ydbd_slice/nodes.py b/ydb/tools/ydbd_slice/nodes.py
index 62a4a742d06..614bae51d5e 100644
--- a/ydb/tools/ydbd_slice/nodes.py
+++ b/ydb/tools/ydbd_slice/nodes.py
@@ -109,7 +109,7 @@ class Nodes(object):
if self._dry_run:
continue
cmd = [
- "ssh", dst, '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', "-A", "sudo", "rsync", "-avqW", "--del",
+ "ssh", dst, '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', "-A", "sudo", "rsync", "-avqW", "--del",
"--no-o", "--no-g", "--rsh='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -l %s'" % os.getenv("USER"),
src, remote_path,
]