From 39900e2ec9cb18e6ac3b668d93be3179bd75d312 Mon Sep 17 00:00:00 2001 From: Lawrence Lui Date: Fri, 8 Apr 2016 10:07:38 -0700 Subject: [PATCH 1/2] changed _build_url to include ability to parse ipv6 host with bracket notation --- winrm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winrm/__init__.py b/winrm/__init__.py index ee40fa9b..1ec9ce83 100644 --- a/winrm/__init__.py +++ b/winrm/__init__.py @@ -94,7 +94,7 @@ def strip_namespace(self, xml): @staticmethod def _build_url(target, transport): match = re.match( - '(?i)^((?Phttp[s]?)://)?(?P[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA + '(?i)^((?Phttp[s]?)://)?(?P\[([0-9A-Fa-f:]+)]|[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA scheme = match.group('scheme') if not scheme: # TODO do we have anything other than HTTP/HTTPS From e22f94e8514e6bd961a7be59700d0522a93989ce Mon Sep 17 00:00:00 2001 From: Lawrence Lui Date: Mon, 11 Apr 2016 10:31:33 -0700 Subject: [PATCH 2/2] removed uneeded paraenthises --- winrm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winrm/__init__.py b/winrm/__init__.py index 1ec9ce83..c72c215e 100644 --- a/winrm/__init__.py +++ b/winrm/__init__.py @@ -94,7 +94,7 @@ def strip_namespace(self, xml): @staticmethod def _build_url(target, transport): match = re.match( - '(?i)^((?Phttp[s]?)://)?(?P\[([0-9A-Fa-f:]+)]|[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA + '(?i)^((?Phttp[s]?)://)?(?P\[[0-9A-Fa-f:]+]|[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA scheme = match.group('scheme') if not scheme: # TODO do we have anything other than HTTP/HTTPS