diff --git a/_deploy.py b/_deploy.py index 549b2c6d4611dcdf7e693efc8dfc1983e06d8a48..243d3afca2cd83638104fca8ec5f5f493f8e18d1 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 d154157eabf0f096154000071dd45a41297a42e7..2c5156cda4bc01bc7f5803033e13cc733575c60c 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 04447df9abe1fc7ebd188ffbeb93ea685b73cf0c..048f6455ec69817a8fb37b22bd1303292884232b 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 53cc6a845e38593c5e69932533a181168ca44ae9..409d7bd3957ffd0fc5afe2fe1c37cc0388e6822e 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 a187a056147f2d85b375f7856962487c6c6f59c1..4267e7041531c954d0c7ba522869e78bd2b658c3 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 2db95b35a703ab51401abfe5eeddbbe9d2c19408..35ceb29f221b5d0fdb7f86cddfb10a32219fff8c 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 518288e47f941e3aa87765a1c3b13426cdb2f657..33a79cb202443a9afdcbba096cc05d8815aeefe5 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):