When using custom salt states we should allow the user to specify this on the command line.

This commit is contained in:
Damian Myerscough 2015-09-02 20:01:18 -07:00
parent 27da42731d
commit 8076c9abb9
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,11 @@ class SaltCall(parsers.SaltCallOptionParser):
pillar_root = os.path.abspath(self.options.pillar_root)
self.config['pillar_roots'] = {'base': _expand_glob_path([pillar_root])}
if self.options.states_dir:
# check if the argument is pointing to a file on disk
states_dir = os.path.abspath(self.options.states_dir)
self.config['states_dirs'] = [states_dir]
if self.options.local:
self.config['file_client'] = 'local'
if self.options.master:

View File

@ -2246,6 +2246,11 @@ class SaltCallOptionParser(six.with_metaclass(OptionParserMeta,
default=None,
help='Set this directory as the base pillar root.'
)
self.add_option(
'--states-dir',
default=None,
help='Set this directory to search for additional states'
)
self.add_option(
'--retcode-passthrough',
default=False,