mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
python tests: Fixed abs_file_name function for Windows
On windows a path containint ':' is considered an absolute path. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
This commit is contained in:
committed by
Gurucharan Shetty
parent
8ac6d39624
commit
42e22f951d
@@ -29,8 +29,10 @@ def abs_file_name(dir_, file_name):
|
||||
Returns None if 'dir_' is None and getcwd() fails.
|
||||
|
||||
This differs from os.path.abspath() in that it will never change the
|
||||
meaning of a file name."""
|
||||
if file_name.startswith('/'):
|
||||
meaning of a file name.
|
||||
|
||||
On Windows an absolute path contains ':' ( i.e: C:\ ) """
|
||||
if file_name.startswith('/') or file_name.find(':') > -1:
|
||||
return file_name
|
||||
else:
|
||||
if dir_ is None or dir_ == "":
|
||||
|
Reference in New Issue
Block a user