Skip to content

"--config-file" option doesn't behave as expected when passing in home dir shortcut #3186

@Mierdin

Description

@Mierdin

The CLI documentation gives an example of being able to pass a different configuration file into the --config-file argument, but this appears to just append this string to the current directory (implying a relative path is required here), rather than evaluate the provided argument as an absolute path:

(virtualenv)vagrant@st2dev:~/st2/st2client$ st2 --config-file=~/.st2/prod-config action list
Traceback (most recent call last):
  File "/home/vagrant/st2/virtualenv/bin/st2", line 11, in <module>
    load_entry_point('st2client==2.2.dev0', 'console_scripts', 'st2')()
  File "/home/vagrant/st2/st2client/st2client/shell.py", line 331, in main
    return Shell().run(argv)
  File "/home/vagrant/st2/st2client/st2client/shell.py", line 272, in run
    config = self._parse_config_file(args=args)
  File "/home/vagrant/st2/st2client/st2client/base.py", line 160, in _parse_config_file
    config_file_path = self._get_config_file_path(args=args)
  File "/home/vagrant/st2/st2client/st2client/base.py", line 179, in _get_config_file_path
    raise ValueError('Config "%s" not found' % (path))
ValueError: Config "/home/vagrant/st2/st2client/~/.st2/prod-config" not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions