Skip to content

Commit

Permalink
python tests: Fixed abs_file_name function for Windows
Browse files Browse the repository at this point in the history
On windows a path containint ':' is considered an absolute path.

Signed-off-by: Paul-Daniel Boca <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
Paul Boca authored and shettyg committed Aug 3, 2016
1 parent 8ac6d39 commit 42e22f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/ovs/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_ == "":
Expand Down

0 comments on commit 42e22f9

Please sign in to comment.