Merge pull request #1 from cro/ab_rootdirfix

Remove extra if statements (rstrip will check for the presence anyway).
This commit is contained in:
Alexandru Bleotu 2017-02-01 17:12:41 +00:00 committed by GitHub
commit b12dd44a26

View file

@ -1747,12 +1747,8 @@ def prepend_root_dir(opts, path_options):
'root_dir' option.
'''
root_dir = os.path.abspath(opts['root_dir'])
root_opt = opts['root_dir']
if root_opt.endswith(os.sep):
root_opt = root_opt.rstrip(os.sep)
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)
def_root_dir = salt.syspaths.ROOT_DIR.rstrip(os.sep)
for path_option in path_options:
if path_option in opts:
path = opts[path_option]