mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Be more careful about stripping away root_dir from directory options
Closes #24885
This commit is contained in:
parent
4e8ed0d8ed
commit
0ecbf261ad
@ -911,14 +911,13 @@ def prepend_root_dir(opts, path_options):
|
||||
'root_dir' option.
|
||||
'''
|
||||
root_dir = os.path.abspath(opts['root_dir'])
|
||||
root_opt = opts['root_dir'].rstrip(os.pathsep)
|
||||
for path_option in path_options:
|
||||
if path_option in opts:
|
||||
if opts[path_option].startswith(opts['root_dir']):
|
||||
opts[path_option] = opts[path_option][len(opts['root_dir']):]
|
||||
opts[path_option] = salt.utils.path_join(
|
||||
root_dir,
|
||||
opts[path_option]
|
||||
)
|
||||
path = opts[path_option]
|
||||
if path == root_opt or path.startswith(root_opt + os.pathsep):
|
||||
path = path[len(root_opt):]
|
||||
opts[path_option] = salt.utils.path_join(root_dir, path)
|
||||
|
||||
|
||||
def insert_system_path(opts, paths):
|
||||
|
Loading…
Reference in New Issue
Block a user