diff mbox

[ovs-dev,V6,10/17] python tests: Fixed abs_file_name function for Windows

Message ID 1467808691-17280-11-git-send-email-pboca@cloudbasesolutions.com
State Superseded
Delegated to: Guru Shetty
Headers show

Commit Message

Paul Boca July 6, 2016, 12:38 p.m. UTC
On windows a path containint ':' is considered an absolute path.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
---
V2: No changes
V3: No changes
V4: No changes
V5: No changes
V6: No changes
---
 python/ovs/util.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alin Serdean July 6, 2016, 9:17 p.m. UTC | #1
Just add a comment in the code so people know.

Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>




> -----Mesaj original-----

> De la: dev [mailto:dev-bounces@openvswitch.org] În numele Paul Boca

> Trimis: Wednesday, July 6, 2016 3:38 PM

> Către: dev@openvswitch.org

> Subiect: [ovs-dev] [PATCH V6 10/17] 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>

> ---

> V2: No changes

> V3: No changes

> V4: No changes

> V5: No changes

> V6: No changes

> ---

>  python/ovs/util.py | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/python/ovs/util.py b/python/ovs/util.py index cb0574b..edcfe81

> 100644

> --- a/python/ovs/util.py

> +++ b/python/ovs/util.py

> @@ -30,7 +30,7 @@ def abs_file_name(dir_, file_name):

> 

>      This differs from os.path.abspath() in that it will never change the

>      meaning of a file name."""

> -    if file_name.startswith('/'):

> +    if file_name.startswith('/') or file_name.find(':') > -1:

>          return file_name

>      else:

>          if dir_ is None or dir_ == "":

> --

> 2.7.2.windows.1

> _______________________________________________

> dev mailing list

> dev@openvswitch.org

> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/python/ovs/util.py b/python/ovs/util.py
index cb0574b..edcfe81 100644
--- a/python/ovs/util.py
+++ b/python/ovs/util.py
@@ -30,7 +30,7 @@  def abs_file_name(dir_, file_name):
 
     This differs from os.path.abspath() in that it will never change the
     meaning of a file name."""
-    if file_name.startswith('/'):
+    if file_name.startswith('/') or file_name.find(':') > -1:
         return file_name
     else:
         if dir_ is None or dir_ == "":