fix file downloads on windows

this is a regression bug introduced in d70914e473
the commit removes the creation of the dest using the sanitised netloc and replaced it with a function that breaks windows downloads...
This commit is contained in:
Rudy Attias 2015-07-16 18:20:03 +03:00 committed by rallytime
parent 48050cd287
commit 6c2f3180c2

View file

@ -545,10 +545,6 @@ class Client(object):
else:
return ''
elif not no_cache:
if salt.utils.is_windows():
netloc = salt.utils.sanitize_win_path_string(url_data.netloc)
else:
netloc = url_data.netloc
dest = self._extrn_path(url, saltenv)
destdir = os.path.dirname(dest)
if not os.path.isdir(destdir):
@ -695,12 +691,16 @@ class Client(object):
Return the extn_filepath for a given url
'''
url_data = urlparse(url)
if salt.utils.is_windows():
netloc = salt.utils.sanitize_win_path_string(url_data.netloc)
else:
netloc = url_data.netloc
return salt.utils.path_join(
self.opts['cachedir'],
'extrn_files',
saltenv,
url_data.netloc,
netloc,
url_data.path
)