You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/10/24 12:33:51 UTC
libcloud git commit: add ex_start_node for the openstack driver
Repository: libcloud
Updated Branches:
refs/heads/trunk afc2d2822 -> 90a8673e8
add ex_start_node for the openstack driver
http://developer.openstack.org/api-ref-compute-v2.1.html
Currently only ex_resume_node is implemented, but it does not start stopped instances.
```
BaseHTTPError: 409 Conflict Cannot 'resume' instance 39ec1234-1234-1234-ba28-123412349d9c while it is in vm_state stopped
```
Closes #919
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/90a8673e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/90a8673e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/90a8673e
Branch: refs/heads/trunk
Commit: 90a8673e82b40defd6b80fe6fb851d4dd62a5a79
Parents: afc2d28
Author: Rick van de Loo <ri...@gmail.com>
Authored: Thu Oct 20 17:02:40 2016 +0200
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Oct 24 13:33:33 2016 +0100
----------------------------------------------------------------------
libcloud/compute/drivers/openstack.py | 3 +++
libcloud/test/compute/test_openstack.py | 8 ++++++++
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/90a8673e/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 8afd8fb..2a5480d 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -2419,6 +2419,9 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
def ex_stop_node(self, node):
return self._post_simple_node_action(node, 'os-stop')
+ def ex_start_node(self, node):
+ return self._post_simple_node_action(node, 'os-start')
+
def ex_suspend_node(self, node):
return self._post_simple_node_action(node, 'suspend')
http://git-wip-us.apache.org/repos/asf/libcloud/blob/90a8673e/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index fad57e3..c6cc76b 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -1445,6 +1445,14 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
ret = self.driver.ex_stop_node(node)
self.assertTrue(ret is True)
+ def test_ex_start_node(self):
+ node = Node(
+ id='12063', name=None, state=None,
+ public_ips=None, private_ips=None, driver=self.driver,
+ )
+ ret = self.driver.ex_start_node(node)
+ self.assertTrue(ret is True)
+
def test_ex_suspend_node(self):
node = Node(
id='12063', name=None, state=None,