Merge pull request #38796 from saltstack/revert-38707-root_dir_fix-gh

Revert "Fixed prepending of root_dir override to the other paths"
This commit is contained in:
Mike Place 2017-01-17 16:18:17 -07:00 committed by GitHub
commit 3417adc617

View file

@ -1747,18 +1747,13 @@ def prepend_root_dir(opts, path_options):
'root_dir' option.
'''
root_dir = os.path.abspath(opts['root_dir'])
def_root_dir = salt.syspaths.ROOT_DIR
if def_root_dir.endswith(os.sep):
def_root_dir = def_root_dir.rstrip(os.sep)
root_opt = opts['root_dir'].rstrip(os.sep)
for path_option in path_options:
if path_option in opts:
path = opts[path_option]
if not os.path.isabs(path):
opts[path_option] = salt.utils.path_join(root_dir, path)
elif path.startswith(def_root_dir) and (root_dir != def_root_dir):
# Strip out the default root_dir and add the updated root_dir
path = path[len(def_root_dir):]
opts[path_option] = salt.utils.path_join(root_dir, path)
if path == root_opt or path.startswith(root_opt + os.sep):
path = path[len(root_opt):]
opts[path_option] = salt.utils.path_join(root_dir, path)
def insert_system_path(opts, paths):