Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Teingi committed Aug 22, 2024
1 parent 5b65336 commit f6f000c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions common/config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def build_configuration(self):
global_ssh_port = self.input_with_default("oceanbase host ssh_port", "22")
global_home_path = self.input_with_default("oceanbase install home_path", const.OB_INSTALL_DIR_DEFAULT)
default_data_dir = os.path.join(global_home_path, "store")
global_data_dir = self.input_with_default("oceanbase data_dir", default_data_dir)
global_redo_dir = self.input_with_default("oceanbase redo_dir", default_data_dir)
global_data_dir = default_data_dir
global_redo_dir = default_data_dir
tenant_sys_config = {"user": self.sys_tenant_user, "password": self.sys_tenant_password}
global_config = {"ssh_username": global_ssh_username, "ssh_password": global_ssh_password, "ssh_port": global_ssh_port, "ssh_key_file": "", "home_path": global_home_path, "data_dir": global_data_dir, "redo_dir": global_redo_dir}
new_config = {"obcluster": {"ob_cluster_name": ob_cluster_name, "db_host": self.db_host, "db_port": self.db_port, "tenant_sys": tenant_sys_config, "servers": {"nodes": nodes_config, "global": global_config}}}
Expand Down
6 changes: 0 additions & 6 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ def __init__(self, stdio=None, config_path=os.path.expanduser('~/.obdiag/config.
if self.inner_config_manager.config.get("obdiag") is not None and self.inner_config_manager.config.get("obdiag").get("logger") is not None and self.inner_config_manager.config.get("obdiag").get("logger").get("silent") is not None:
stdio.set_silent(self.inner_config_manager.config.get("obdiag").get("logger").get("silent"))
self.set_stdio(stdio)
if config_path:
if os.path.exists(os.path.abspath(config_path)):
config_path = config_path
else:
stdio.error('The option you provided with -c: {0} is not exist.'.format(config_path))
return
self.config_manager = ConfigManager(config_path, stdio, custom_config_env_list)
if (
self.inner_config_manager.config.get("obdiag") is not None
Expand Down
7 changes: 0 additions & 7 deletions diag_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,7 @@ def do_command(self):
ROOT_IO.verbose('cmd: %s' % self.prev_cmd)
ROOT_IO.verbose('opts: %s' % self.opts)
config_path = os.path.expanduser('~/.obdiag/config.yml')
custom_config_c_option = Util.get_option(self.opts, 'c')
custom_config_env_list = Util.get_option(self.opts, 'config')
if custom_config_c_option:
if os.path.exists(os.path.abspath(custom_config_c_option)):
config_path = custom_config_c_option
else:
ROOT_IO.error('The option you provided with -c: {0} is a non-existent configuration file path.'.format(config_path))
return
obdiag = ObdiagHome(stdio=ROOT_IO, config_path=config_path, inner_config_change_map=self.inner_config_change_map, custom_config_env_list=custom_config_env_list)
obdiag.set_options(self.opts)
obdiag.set_cmds(self.cmds)
Expand Down

0 comments on commit f6f000c

Please sign in to comment.