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 2014/08/06 16:31:11 UTC

git commit: Fix a bug in ex_get_console_output in the EC2 driver which would cause an exception to be thrown if there was no console output for a particular node.

Repository: libcloud
Updated Branches:
  refs/heads/trunk a9eebae82 -> 763236f36


Fix a bug in ex_get_console_output in the EC2 driver which would cause
an exception to be thrown if there was no console output for a particular
node.

Reported by Chris DeRamus.


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

Branch: refs/heads/trunk
Commit: 763236f36848ccefb4aa6e5b14b5582135112669
Parents: a9eebae
Author: Tomaz Muraus <to...@apache.org>
Authored: Wed Aug 6 16:25:07 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Wed Aug 6 16:25:38 2014 +0200

----------------------------------------------------------------------
 CHANGES.rst                     | 7 +++++++
 libcloud/compute/drivers/ec2.py | 7 ++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/763236f3/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 92980a8..4ac10f0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -37,6 +37,13 @@ Compute
   ``OpenStackServiceCatalog`` class.
   [Andrew Mann, Tomaz Muraus]
 
+- Fix a bug in ``ex_get_console_output`` in the EC2 driver which would cause
+  an exception to be thrown if there was no console output for a particular
+  node.
+
+  Reported by Chris DeRamus.
+  [Tomaz Muraus]
+
 Loadbalancer
 ~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/763236f3/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index c17f072..af13a3d 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3733,7 +3733,12 @@ class BaseEC2NodeDriver(NodeDriver):
                                   namespace=NAMESPACE)
 
         timestamp = parse_date(timestamp)
-        output = base64.b64decode(b(encoded_string)).decode('utf-8')
+
+        if encoded_string:
+            output = base64.b64decode(b(encoded_string)).decode('utf-8')
+        else:
+            # No console output
+            output = None
 
         return {'instance_id': node.id,
                 'timestamp': timestamp,