You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2015/06/20 10:41:52 UTC

[1/4] libcloud git commit: Add check windows os in is_valid_ip_address to run inet_aton

Repository: libcloud
Updated Branches:
  refs/heads/trunk fd89abb57 -> e105433e9


Add check windows os in is_valid_ip_address to run inet_aton

Closes #343
Closes #498

Signed-off-by: Tomaz Muraus <to...@tomaz.me>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/918cb0f7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/918cb0f7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/918cb0f7

Branch: refs/heads/trunk
Commit: 918cb0f765d03aefc2aee75039d074b387ab0184
Parents: fd89abb
Author: 503264 <50...@bnpparibas.com>
Authored: Wed Jul 30 12:13:15 2014 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Jun 20 16:28:28 2015 +0800

----------------------------------------------------------------------
 libcloud/utils/networking.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/918cb0f7/libcloud/utils/networking.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/networking.py b/libcloud/utils/networking.py
index d508d24..b49cc15 100644
--- a/libcloud/utils/networking.py
+++ b/libcloud/utils/networking.py
@@ -5,7 +5,7 @@
 # (the "License"); you may not use this file except in compliance with
 # the License.  You may obtain a copy of the License at
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,6 +15,7 @@
 
 import socket
 import struct
+import platform
 
 __all__ = [
     'is_private_subnet',
@@ -75,7 +76,10 @@ def is_valid_ip_address(address, family=socket.AF_INET):
     :return: ``bool`` True if the provided address is valid.
     """
     try:
-        socket.inet_pton(family, address)
+        if (platform.system() == 'Windows'):
+            socket.inet_aton(address)
+        else:
+            socket.inet_pton(family, address)
     except socket.error:
         return False
 


[4/4] libcloud git commit: Fix typo.

Posted by to...@apache.org.
Fix typo.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e105433e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e105433e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e105433e

Branch: refs/heads/trunk
Commit: e105433e941262e03eb3bb922db47dabdd8efa75
Parents: 0b6ac9d
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sat Jun 20 16:40:13 2015 +0800
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Jun 20 16:40:13 2015 +0800

----------------------------------------------------------------------
 libcloud/utils/networking.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e105433e/libcloud/utils/networking.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/networking.py b/libcloud/utils/networking.py
index 88c1cb4..398cef5 100644
--- a/libcloud/utils/networking.py
+++ b/libcloud/utils/networking.py
@@ -78,7 +78,7 @@ def is_valid_ip_address(address, family=socket.AF_INET):
     is_windows = platform.system() == 'Windows'
 
     if is_windows and family == socket.AF_INET6:
-        raise ValueError('Checking IPv6 addresses are not supported on Windows')
+        raise ValueError('Checking IPv6 addresses is not supported on Windows')
 
     try:
         if is_windows:


[3/4] libcloud git commit: Update changelog.

Posted by to...@apache.org.
Update changelog.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/0b6ac9dd
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/0b6ac9dd
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/0b6ac9dd

Branch: refs/heads/trunk
Commit: 0b6ac9ddfce471d36b624cb627c8bb4b286c1171
Parents: b276c2d
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sat Jun 20 16:35:49 2015 +0800
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Jun 20 16:35:49 2015 +0800

----------------------------------------------------------------------
 CHANGES.rst | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0b6ac9dd/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index dfec2f8..bec87fa 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -27,6 +27,10 @@ General
   (GITHUB-533, LIBCLOUD-716)
   [Avi Weit]
 
+- Update ``is_valid_ip_address`` function so it also works on Windows.
+  (GITHUB-343, GITHUB-498, LIBCLOUD-601, LIBCLOUD-686)
+  [Nicolas Fraison, Samuel Marks]
+
 Compute
 ~~~~~~~
 


[2/4] libcloud git commit: Update is_valid_ip_address to throw when checking for IPv6 address on Windows.

Posted by to...@apache.org.
Update is_valid_ip_address to throw when checking for IPv6 address on Windows.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b276c2dc
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b276c2dc
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b276c2dc

Branch: refs/heads/trunk
Commit: b276c2dc735418145910b30eecfa3beac31a5fce
Parents: 918cb0f
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sat Jun 20 16:32:20 2015 +0800
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Jun 20 16:32:20 2015 +0800

----------------------------------------------------------------------
 libcloud/utils/networking.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b276c2dc/libcloud/utils/networking.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/networking.py b/libcloud/utils/networking.py
index b49cc15..88c1cb4 100644
--- a/libcloud/utils/networking.py
+++ b/libcloud/utils/networking.py
@@ -75,8 +75,13 @@ def is_valid_ip_address(address, family=socket.AF_INET):
 
     :return: ``bool`` True if the provided address is valid.
     """
+    is_windows = platform.system() == 'Windows'
+
+    if is_windows and family == socket.AF_INET6:
+        raise ValueError('Checking IPv6 addresses are not supported on Windows')
+
     try:
-        if (platform.system() == 'Windows'):
+        if is_windows:
             socket.inet_aton(address)
         else:
             socket.inet_pton(family, address)