Skip to content

Commit

Permalink
Merge pull request #249 from Teingi/2.2.x_plan_monitor
Browse files Browse the repository at this point in the history
fixed when -c is a non-existent configuration file path
  • Loading branch information
Teingi authored Jun 12, 2024
2 parents 28e9a99 + f30d63d commit 3e2d9aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ def do_command(self):
config_path = os.path.expanduser('~/.obdiag/config.yml')
custom_config = Util.get_option(self.opts, 'c')
if custom_config:
config_path = custom_config
if os.path.exists(os.path.abspath(custom_config)):
config_path = custom_config
else:
ROOT_IO.error('The option you provided with -c: {0} is a non-existent configuration file path.'.format(custom_config))
return
obdiag = ObdiagHome(stdio=ROOT_IO, config_path=config_path)
obdiag.set_options(self.opts)
obdiag.set_cmds(self.cmds)
Expand Down

0 comments on commit 3e2d9aa

Please sign in to comment.