From 7ac5be6c8f60b678c8fb8fd74c1d41fa8bc91c04 Mon Sep 17 00:00:00 2001 From: Rongfeng Fu Date: Wed, 6 Apr 2022 14:54:41 +0800 Subject: [PATCH] typo (#96) --- _deploy.py | 4 ++-- plugins/oceanbase/3.1.0/create_tenant.py | 6 +++--- plugins/oceanbase/3.1.0/generate_config.py | 6 +++--- plugins/oceanbase/3.1.0/start_check.py | 2 +- plugins/oceanbase/3.1.0/upgrade_route.py | 6 +++--- plugins/sysbench/3.1.0/run_test.py | 6 +++--- plugins/tpch/3.1.0/run_test.py | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/_deploy.py b/_deploy.py index 549b2c6..243d3af 100644 --- a/_deploy.py +++ b/_deploy.py @@ -1035,7 +1035,7 @@ class ConfigParserManager(Manager): } self.component_parsers = {} - def _formate_paraser_name(self, style): + def _format_paraser_name(self, style): style = style.title() return '%sConfigParser' % style.replace('-', '').replace(' ', '').replace('_', '') @@ -1048,7 +1048,7 @@ class ConfigParserManager(Manager): DynamicLoading.add_lib_path(lib_path) self.stdio and getattr(self.stdio, 'verbose', 'print')('load config parser: %s' % path) module = DynamicLoading.import_module(module_name, self.stdio) - clz_name = self._formate_paraser_name(style) + clz_name = self._format_paraser_name(style) try: return getattr(module, clz_name) except: diff --git a/plugins/oceanbase/3.1.0/create_tenant.py b/plugins/oceanbase/3.1.0/create_tenant.py index d154157..2c5156c 100644 --- a/plugins/oceanbase/3.1.0/create_tenant.py +++ b/plugins/oceanbase/3.1.0/create_tenant.py @@ -43,14 +43,14 @@ def format_size(size, precision=1): idx = 0 if precision: div = 1024.0 - formate = '%.' + str(precision) + 'f%s' + format = '%.' + str(precision) + 'f%s' else: div = 1024 - formate = '%d%s' + format = '%d%s' while idx < 5 and size >= 1024: size /= 1024.0 idx += 1 - return formate % (size, units[idx]) + return format % (size, units[idx]) def create_tenant(plugin_context, cursor, *args, **kwargs): diff --git a/plugins/oceanbase/3.1.0/generate_config.py b/plugins/oceanbase/3.1.0/generate_config.py index 04447df..048f645 100644 --- a/plugins/oceanbase/3.1.0/generate_config.py +++ b/plugins/oceanbase/3.1.0/generate_config.py @@ -43,16 +43,16 @@ def format_size(size, precision=1): idx = 0 if precision: div = 1024.0 - formate = '%.' + str(precision) + 'f%s' + format = '%.' + str(precision) + 'f%s' limit = 1024 else: div = 1024 limit = 1024 - formate = '%d%s' + format = '%d%s' while idx < units_num and size >= limit: size /= div idx += 1 - return formate % (size, units[idx]) + return format % (size, units[idx]) def get_system_memory(memory_limit): diff --git a/plugins/oceanbase/3.1.0/start_check.py b/plugins/oceanbase/3.1.0/start_check.py index 53cc6a8..409d7bd 100644 --- a/plugins/oceanbase/3.1.0/start_check.py +++ b/plugins/oceanbase/3.1.0/start_check.py @@ -216,7 +216,7 @@ def _start_check(plugin_context, strict_check=False, *args, **kwargs): free_memory = parse_size(str(v)) total_use = servers_memory[ip]['percentage'] * total_memory / 100 + servers_memory[ip]['num'] if total_use > free_memory: - stdio.error(EC_OBSERVER_NOT_ENOUGH_MEMORY.formate(ip=ip, free=format_size(free_memory), need=format_size(total_use))) + stdio.error(EC_OBSERVER_NOT_ENOUGH_MEMORY.format(ip=ip, free=format_size(free_memory), need=format_size(total_use))) # disk disk = {'/': 0} ret = client.execute_command('df --block-size=1024') diff --git a/plugins/oceanbase/3.1.0/upgrade_route.py b/plugins/oceanbase/3.1.0/upgrade_route.py index a187a05..4267e70 100644 --- a/plugins/oceanbase/3.1.0/upgrade_route.py +++ b/plugins/oceanbase/3.1.0/upgrade_route.py @@ -157,10 +157,10 @@ class ObVersionGraph(object): if len(res) == 1: res.insert(0, start_node) - return formate_route(res) + return format_route(res) -def formate_route(routes): +def format_route(routes): return [{ 'version': node.version, 'release': None if node.release == VersionNode.RELEASE_NULL else node.release, @@ -174,7 +174,7 @@ def upgrade_route(plugin_context, current_repository, dest_repository, *args, ** repository_dir = dest_repository.repository_dir if current_repository.version == dest_repository.version: - return plugin_context.return_true(route=formate_route([current_repository, dest_repository])) + return plugin_context.return_true(route=format_route([current_repository, dest_repository])) upgrade_dep_name = 'etc/oceanbase_upgrade_dep.yml' upgrade_dep_path = os.path.join(repository_dir, upgrade_dep_name) diff --git a/plugins/sysbench/3.1.0/run_test.py b/plugins/sysbench/3.1.0/run_test.py index 2db95b3..35ceb29 100644 --- a/plugins/sysbench/3.1.0/run_test.py +++ b/plugins/sysbench/3.1.0/run_test.py @@ -51,16 +51,16 @@ def format_size(size, precision=1): idx = 0 if precision: div = 1024.0 - formate = '%.' + str(precision) + 'f%s' + format = '%.' + str(precision) + 'f%s' limit = 1024 else: div = 1024 limit = 1024 - formate = '%d%s' + format = '%d%s' while idx < units_num and size >= limit: size /= div idx += 1 - return formate % (size, units[idx]) + return format % (size, units[idx]) def exec_cmd(cmd): diff --git a/plugins/tpch/3.1.0/run_test.py b/plugins/tpch/3.1.0/run_test.py index 518288e..33a79cb 100644 --- a/plugins/tpch/3.1.0/run_test.py +++ b/plugins/tpch/3.1.0/run_test.py @@ -51,16 +51,16 @@ def format_size(size, precision=1): idx = 0 if precision: div = 1024.0 - formate = '%.' + str(precision) + 'f%s' + format = '%.' + str(precision) + 'f%s' limit = 1024 else: div = 1024 limit = 1024 - formate = '%d%s' + format = '%d%s' while idx < units_num and size >= limit: size /= div idx += 1 - return formate % (size, units[idx]) + return format % (size, units[idx]) def exec_cmd(cmd): -- GitLab