You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2017/09/27 04:30:20 UTC

[1/2] libcloud git commit: Fix checking for "location is None" in several functions

Repository: libcloud
Updated Branches:
  refs/heads/trunk 4d5934230 -> 4e42f86bb


Fix checking for "location is None" in several functions

Closes #1098

Signed-off-by: Quentin Pradet <qu...@apache.org>


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

Branch: refs/heads/trunk
Commit: fe0a8484c5bab6bafa156663f81a6cda53f1e492
Parents: 4d59342
Author: Elsharkawy, Sameh <se...@card.core>
Authored: Wed Sep 27 08:17:16 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Wed Sep 27 08:21:25 2017 +0400

----------------------------------------------------------------------
 CHANGES.rst                           |  3 +++
 libcloud/compute/drivers/azure_arm.py | 27 +++++++++++++++------------
 2 files changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fe0a8484/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index ab64c0e..fe13a41 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -25,6 +25,9 @@ Compute
 - [GCE] Fix `GCEList` pagination. (GITHUB-1095)
   [Yap Sok Ann]
 
+- [ARM] Fix checking for "location is None" in several functions (LIBCLOUD-926, GITHUB-1098)
+  [Sameh Elsharkawy]
+
 Changes in Apache Libcloud 2.2.1
 --------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fe0a8484/libcloud/compute/drivers/azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index 8950c2a..45db5a1 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1407,10 +1407,11 @@ class AzureNodeDriver(NodeDriver):
         :type location: :class:`.NodeLocation`
         """
 
-        if location is None and self.default_location:
-            location = self.default_location
-        else:
-            raise ValueError("location is required.")
+        if location is None:
+            if self.default_location:
+                location = self.default_location
+            else:
+                raise ValueError("location is required.")
 
         target = "/subscriptions/%s/resourceGroups/%s/" \
                  "providers/Microsoft.Network/networkSecurityGroups/%s" \
@@ -1440,10 +1441,11 @@ class AzureNodeDriver(NodeDriver):
         :type location: :class:`.NodeLocation`
         """
 
-        if location is None and self.default_location:
-            location = self.default_location
-        else:
-            raise ValueError("location is required.")
+        if location is None:
+            if self.default_location:
+                location = self.default_location
+            else:
+                raise ValueError("location is required.")
 
         target = "/subscriptions/%s/resourceGroups/%s/" \
                  "providers/Microsoft.Network/networkSecurityGroups/%s" \
@@ -1628,10 +1630,11 @@ class AzureNodeDriver(NodeDriver):
         :rtype: :class:`.AzureIPAddress`
         """
 
-        if location is None and self.default_location:
-            location = self.default_location
-        else:
-            raise ValueError("location is required.")
+        if location is None:
+            if self.default_location:
+                location = self.default_location
+            else:
+                raise ValueError("location is required.")
 
         target = "/subscriptions/%s/resourceGroups/%s/" \
                  "providers/Microsoft.Network/publicIPAddresses/%s" \


[2/2] libcloud git commit: Fix error when using SSH key auth with Python 3

Posted by qu...@apache.org.
Fix error when using SSH key auth with Python 3

When using SSH key authentication, the randomly generated HEX password for admin account is encoded as bytes which results in a JSON serialization error. Changed the encoding to UTF-8.

Signed-off-by: Quentin Pradet <qu...@apache.org>


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

Branch: refs/heads/trunk
Commit: 4e42f86bb9b3824e92874e0aedea83d7b649d1ed
Parents: fe0a848
Author: SElsharkawy <El...@NiLogix.com>
Authored: Tue May 2 13:50:48 2017 -0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Wed Sep 27 08:25:25 2017 +0400

----------------------------------------------------------------------
 CHANGES.rst                           | 3 +++
 libcloud/compute/drivers/azure_arm.py | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e42f86b/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index fe13a41..7ba1806 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -28,6 +28,9 @@ Compute
 - [ARM] Fix checking for "location is None" in several functions (LIBCLOUD-926, GITHUB-1098)
   [Sameh Elsharkawy]
 
+- [ARM] Fix error when using SSH key auth with Python 3 (GITHUB-1098)
+  [Sameh Elsharkawy]
+
 Changes in Apache Libcloud 2.2.1
 --------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e42f86b/libcloud/compute/drivers/azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index 45db5a1..38ca2ae 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -623,7 +623,7 @@ class AzureNodeDriver(NodeDriver):
 
         if isinstance(auth, NodeAuthSSHKey):
             data["properties"]["osProfile"]["adminPassword"] = \
-                binascii.hexlify(os.urandom(20))
+                binascii.hexlify(os.urandom(20)).decode("utf-8")
             data["properties"]["osProfile"]["linuxConfiguration"] = {
                 "disablePasswordAuthentication": "true",
                 "ssh": {