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 2013/04/21 20:21:26 UTC

svn commit: r1470330 - in /libcloud/branches/0.12.x: ./ CHANGES libcloud/compute/drivers/joyent.py libcloud/test/compute/test_joyent.py

Author: tomaz
Date: Sun Apr 21 18:21:25 2013
New Revision: 1470330

URL: http://svn.apache.org/r1470330
Log:
Backport commit from trunk.

Modified:
    libcloud/branches/0.12.x/   (props changed)
    libcloud/branches/0.12.x/CHANGES
    libcloud/branches/0.12.x/libcloud/compute/drivers/joyent.py
    libcloud/branches/0.12.x/libcloud/test/compute/test_joyent.py

Propchange: libcloud/branches/0.12.x/
------------------------------------------------------------------------------
  Merged /libcloud/trunk:r1470329

Modified: libcloud/branches/0.12.x/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/CHANGES?rev=1470330&r1=1470329&r2=1470330&view=diff
==============================================================================
--- libcloud/branches/0.12.x/CHANGES (original)
+++ libcloud/branches/0.12.x/CHANGES Sun Apr 21 18:21:25 2013
@@ -7,6 +7,9 @@ Changes with Apache Libcloud in deveplom
     - Fix destroy_node method in the experimental libvirt driver.
       [Aymen Fitati]
 
+    - Add ex_start_node method to the Joyent driver. (LIBCLOUD-319)
+      [rszabo50]
+
 Changes with Apache Libcloud 0.12.4:
 
  *) Compute

Modified: libcloud/branches/0.12.x/libcloud/compute/drivers/joyent.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/compute/drivers/joyent.py?rev=1470330&r1=1470329&r2=1470330&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/compute/drivers/joyent.py (original)
+++ libcloud/branches/0.12.x/libcloud/compute/drivers/joyent.py Sun Apr 21 18:21:25 2013
@@ -186,6 +186,20 @@ class JoyentNodeDriver(NodeDriver):
                                          data=data, method='POST')
         return result.status == httplib.ACCEPTED
 
+    def ex_start_node(self, node):
+        """
+        Start node
+
+        @param  node: The node to be stopped
+        @type   node: L{Node}
+
+        @rtype: C{bool}
+        """
+        data = json.dumps({'action': 'start'})
+        result = self.connection.request('/my/machines/%s' % (node.id),
+                                         data=data, method='POST')
+        return result.status == httplib.ACCEPTED
+
     def _to_node(self, data):
         state = NODE_STATE_MAP[data['state']]
         public_ips = []

Modified: libcloud/branches/0.12.x/libcloud/test/compute/test_joyent.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/compute/test_joyent.py?rev=1470330&r1=1470329&r2=1470330&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/compute/test_joyent.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/compute/test_joyent.py Sun Apr 21 18:21:25 2013
@@ -76,6 +76,10 @@ class JoyentTestCase(unittest.TestCase):
         node = self.driver.list_nodes()[0]
         self.assertTrue(self.driver.ex_stop_node(node))
 
+    def test_ex_start_node(self):
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.ex_start_node(node))
+
 
 class JoyentHttp(MockHttp):
     fixtures = ComputeFileFixtures('joyent')