Removing posible double '/' from the file paths

This commit is contained in:
Pablo Suárez Hernández 2017-01-03 08:32:36 +00:00
parent 8b4f87f226
commit e9919a913f

View file

@ -651,6 +651,10 @@ def diff(config='root', filename=None, num_pre=None, num_post=None):
pre_file = os.path.normpath(pre_mount + "/" + _filepath)
post_file = os.path.normpath(post_mount + "/" + _filepath)
# Just in case, removing posible double '/' from the final file paths
pre_file = pre_file.replace("//", "/")
post_file = post_file.replace("//", "/")
if os.path.isfile(pre_file):
pre_file_exists = True
pre_file_content = salt.utils.fopen(pre_file).readlines()