[SSL] fix validate_writeable_directory
We have to exmand user if ~ was used in path and we have to use normpath in order not to traverse nonexisting directory and remove trailing /. Change-Id: Ic44917b6a1e01c9565cef1df60ed57d3da39cf33
This commit is contained in:
@@ -207,8 +207,10 @@ def validate_writeable_directory(param, options=None):
|
||||
return
|
||||
|
||||
options = options or []
|
||||
if not ((os.path.isdir(param) and os.access(param, os.W_OK)) or
|
||||
os.access(os.path.join(param, os.pardir), os.W_OK)):
|
||||
path = os.path.expanduser(param)
|
||||
if not ((os.path.isdir(path) and os.access(path, os.W_OK)) or
|
||||
os.access(
|
||||
os.path.normpath(os.path.join(path, os.pardir)), os.W_OK)):
|
||||
logging.debug('validate_writeable_directory(%s, options=%s) failed.' %
|
||||
(param, options))
|
||||
msg = 'Given directory does not exist or is not writeable: %s'
|
||||
|
Reference in New Issue
Block a user