libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1406803 - /libcloud/trunk/libcloud/compute/drivers/hostvirtual.py
Date Wed, 07 Nov 2012 21:03:37 GMT
Author: tomaz
Date: Wed Nov  7 21:03:36 2012
New Revision: 1406803

URL: http://svn.apache.org/viewvc?rev=1406803&view=rev
Log:
Improve the return value.

Modified:
    libcloud/trunk/libcloud/compute/drivers/hostvirtual.py

Modified: libcloud/trunk/libcloud/compute/drivers/hostvirtual.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/hostvirtual.py?rev=1406803&r1=1406802&r2=1406803&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/hostvirtual.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/hostvirtual.py Wed Nov  7 21:03:36 2012
@@ -220,16 +220,16 @@ class HostVirtualNodeDriver(NodeDriver):
             API_ROOT + '/cloud/server/reboot',
             data=json.dumps(params),
             method='POST').object
-        if result:
-            return True
+
+        return bool(result)
 
     def destroy_node(self, node):
         params = {'mbpkgid': node.id}
         result = self.connection.request(
             API_ROOT + '/cloud/cancel', data=json.dumps(params),
             method='POST').object
-        if result:
-            return True
+
+        return bool(result)
 
     def ex_stop_node(self, node):
         params = {'force': 0, 'mbpkgid': node.id}
@@ -237,8 +237,8 @@ class HostVirtualNodeDriver(NodeDriver):
             API_ROOT + '/cloud/server/stop',
             data=json.dumps(params),
             method='POST').object
-        if result:
-            return True
+
+        return bool(result)
 
     def ex_start_node(self, node):
         params = {'mbpkgid': node.id}
@@ -246,5 +246,5 @@ class HostVirtualNodeDriver(NodeDriver):
             API_ROOT + '/cloud/server/start',
             data=json.dumps(params),
             method='POST').object
-        if result:
-            return True
+
+        return bool(result)



Mime
View raw message