libcloud git commit: changes for #922

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk 1e19061df -> 9e5976c95


changes for #922


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

Branch: refs/heads/trunk
Commit: 9e5976c952af89d6de2facbd0debc5c3fcbb0612
Parents: 1e19061
Author: Anthony Shaw 
Authored: Mon Oct 24 16:45:03 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 16:45:03 2016 +0100

--
 CHANGES.rst | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9e5976c9/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 243416a..a890e74 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
 Compute
 ~~~
 
+- [digital ocean] add ex_change_kernel in DigitalOcean_v2 driver
+  (GITHUB-922)
+  [Rick van de Loo]
+
 - [digital ocean] add ex_hard_reboot in DigitalOcean_v2 driver
   (GITHUB-920)
   [Rick van de Loo]



libcloud git commit: add ex_change_kernel in DigitalOcean_v2 driver

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk 5ef94eb3a -> 1e19061df


add ex_change_kernel in DigitalOcean_v2 driver

> To change the kernel of a Droplet, send a POST request to
> /v2/droplets/$DROPLET_ID/actions. Set the "type" attribute to
> change_kernel and the "kernel" attribute to the new kernel's ID.

https://developers.digitalocean.com/documentation/v2/#change-the-kernel

Closes #922


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

Branch: refs/heads/trunk
Commit: 1e19061dffed59008ca110dae7afe032d31287ce
Parents: 5ef94eb
Author: Rick van de Loo 
Authored: Mon Oct 24 14:42:59 2016 +0200
Committer: Anthony Shaw 
Committed: Mon Oct 24 16:43:30 2016 +0100

--
 libcloud/compute/drivers/digitalocean.py|  6 ++
 .../compute/fixtures/digitalocean/ex_change_kernel.json | 12 
 .../fixtures/digitalocean_v2/ex_change_kernel.json  | 12 
 libcloud/test/compute/test_digitalocean_v2.py   | 11 +++
 4 files changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/1e19061d/libcloud/compute/drivers/digitalocean.py
--
diff --git a/libcloud/compute/drivers/digitalocean.py 
b/libcloud/compute/drivers/digitalocean.py
index 335e065..9800023 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -244,6 +244,12 @@ class 
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
 data = self._paginated_request('/v2/images/%s' % (image_id), 'image')
 return self._to_image(data)
 
+def ex_change_kernel(self, node, kernel_id):
+attr = {'type': 'change_kernel', 'kernel': kernel_id}
+res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
+  data=json.dumps(attr), method='POST')
+return res.status == httplib.CREATED
+
 def ex_rename_node(self, node, name):
 attr = {'type': 'rename', 'name': name}
 res = self.connection.request('/v2/droplets/%s/actions' % (node.id),

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1e19061d/libcloud/test/compute/fixtures/digitalocean/ex_change_kernel.json
--
diff --git a/libcloud/test/compute/fixtures/digitalocean/ex_change_kernel.json 
b/libcloud/test/compute/fixtures/digitalocean/ex_change_kernel.json
new file mode 100644
index 000..561101f
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean/ex_change_kernel.json
@@ -0,0 +1,12 @@
+{
+  "action": {
+"id": 36077295,
+"status": "in-progress",
+"type": "kernel_change",
+"started_at": "2014-11-04T17:08:03Z",
+"completed_at": null,
+"resource_id": 3067650,
+"resource_type": "droplet",
+"region": "ams2"
+  }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1e19061d/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json
--
diff --git 
a/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json 
b/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json
new file mode 100644
index 000..561101f
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_change_kernel.json
@@ -0,0 +1,12 @@
+{
+  "action": {
+"id": 36077295,
+"status": "in-progress",
+"type": "kernel_change",
+"started_at": "2014-11-04T17:08:03Z",
+"completed_at": null,
+"resource_id": 3067650,
+"resource_type": "droplet",
+"region": "ams2"
+  }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1e19061d/libcloud/test/compute/test_digitalocean_v2.py
--
diff --git a/libcloud/test/compute/test_digitalocean_v2.py 
b/libcloud/test/compute/test_digitalocean_v2.py
index 2ba7e90..88dcea6 100644
--- a/libcloud/test/compute/test_digitalocean_v2.py
+++ b/libcloud/test/compute/test_digitalocean_v2.py
@@ -160,6 +160,12 @@ class DigitalOcean_v2_Tests(LibcloudTestCase):
 result = self.driver.destroy_node(node)
 self.assertTrue(result)
 
+def test_ex_change_kernel_success(self):
+node = self.driver.list_nodes()[0]
+DigitalOceanMockHttp.type = 'KERNELCHANGE'
+result = self.driver.ex_change_kernel(node, 7515)
+self.assertTrue(result)
+
 def test_ex_rename_node_success(self):
 node = self.driver.list_nodes()[0]
 DigitalOceanMockHttp.type = 'RENAME'
@@ -301,6 +307,11 @@ 

[GitHub] libcloud pull request #922: add ex_change_kernel in DigitalOcean_v2 driver

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/922


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] libcloud pull request #922: add ex_change_kernel in DigitalOcean_v2 driver

2016-10-24 Thread vdloo
GitHub user vdloo opened a pull request:

https://github.com/apache/libcloud/pull/922

add ex_change_kernel in DigitalOcean_v2 driver

### add ex_change_kernel in DigitalOcean_v2 driver

 So the kernel can be managed using the API


> To change the kernel of a Droplet, send a POST request to
> /v2/droplets/$DROPLET_ID/actions. Set the "type" attribute to
> change_kernel and the "kernel" attribute to the new kernel's ID.

https://developers.digitalocean.com/documentation/v2/#change-the-kernel

The `DigitalOcean GrubLoader` can also be set with this allowing for 
[Internal Kernel 
Management](https://www.digitalocean.com/community/tutorials/how-to-update-a-digitalocean-server-s-kernel)
 in a Droplet.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/vdloo/libcloud implement-ex-change-kernel

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/922.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #922


commit 0f4d52dfab5ea18a49871fc6d207c39d8a5a4f49
Author: Rick van de Loo 
Date:   2016-10-24T12:42:59Z

add ex_change_kernel in DigitalOcean_v2 driver

> To change the kernel of a Droplet, send a POST request to
> /v2/droplets/$DROPLET_ID/actions. Set the "type" attribute to
> change_kernel and the "kernel" attribute to the new kernel's ID.

https://developers.digitalocean.com/documentation/v2/#change-the-kernel




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] libcloud pull request #920: add ex_hard_reboot in DigitalOcean_v2 driver

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/920


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/3] libcloud git commit: add ex_hard_reboot in DigitalOcean_v2 driver

2016-10-24 Thread anthonyshaw
add ex_hard_reboot in DigitalOcean_v2 driver

implement power_cycle
Closes #920


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

Branch: refs/heads/trunk
Commit: da5f68045147a036d189fc606fb4720951bd03e0
Parents: 3a1928a
Author: Rick van de Loo 
Authored: Fri Oct 21 14:17:42 2016 +0200
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:37:43 2016 +0100

--
 libcloud/compute/drivers/digitalocean.py|  6 ++
 .../compute/fixtures/digitalocean/ex_hard_reboot.json   | 12 
 .../fixtures/digitalocean_v2/ex_hard_reboot.json| 12 
 libcloud/test/compute/test_digitalocean_v2.py   | 12 
 4 files changed, 42 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/compute/drivers/digitalocean.py
--
diff --git a/libcloud/compute/drivers/digitalocean.py 
b/libcloud/compute/drivers/digitalocean.py
index 7a676b6..335e065 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -256,6 +256,12 @@ class 
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
   data=json.dumps(attr), method='POST')
 return res.status == httplib.CREATED
 
+def ex_hard_reboot(self, node):
+attr = {'type': 'power_cycle'}
+res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
+  data=json.dumps(attr), method='POST')
+return res.status == httplib.CREATED
+
 def ex_power_on_node(self, node):
 attr = {'type': 'power_on'}
 res = self.connection.request('/v2/droplets/%s/actions' % (node.id),

http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
--
diff --git a/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json 
b/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
new file mode 100644
index 000..891b32e
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
@@ -0,0 +1,12 @@
+{
+  "action": {
+"id": 36077294,
+"status": "in-progress",
+"type": "power_cycle",
+"started_at": "2014-11-04T17:08:03Z",
+"completed_at": null,
+"resource_id": 3067651,
+"resource_type": "droplet",
+"region": "ams3"
+  }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
--
diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json 
b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
new file mode 100644
index 000..891b32e
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
@@ -0,0 +1,12 @@
+{
+  "action": {
+"id": 36077294,
+"status": "in-progress",
+"type": "power_cycle",
+"started_at": "2014-11-04T17:08:03Z",
+"completed_at": null,
+"resource_id": 3067651,
+"resource_type": "droplet",
+"region": "ams3"
+  }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/test_digitalocean_v2.py
--
diff --git a/libcloud/test/compute/test_digitalocean_v2.py 
b/libcloud/test/compute/test_digitalocean_v2.py
index c7a916d..2ba7e90 100644
--- a/libcloud/test/compute/test_digitalocean_v2.py
+++ b/libcloud/test/compute/test_digitalocean_v2.py
@@ -148,6 +148,12 @@ class DigitalOcean_v2_Tests(LibcloudTestCase):
 result = self.driver.ex_shutdown_node(node)
 self.assertTrue(result)
 
+def test_ex_hard_reboot_success(self):
+node = self.driver.list_nodes()[0]
+DigitalOceanMockHttp.type = 'POWERCYCLE'
+result = self.driver.ex_hard_reboot(node)
+self.assertTrue(result)
+
 def test_destroy_node_success(self):
 node = self.driver.list_nodes()[0]
 DigitalOceanMockHttp.type = 'DESTROY'
@@ -327,6 +333,12 @@ class DigitalOceanMockHttp(MockHttpTestCase):
 body = self.fixtures.load('ex_shutdown_node.json')
 return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED])
 
+def _v2_droplets_316_actions_POWERCYCLE(self, method, url,
+body, headers):
+# ex_hard_reboot
+body = 

[3/3] libcloud git commit: changes for #920

2016-10-24 Thread anthonyshaw
changes for #920


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

Branch: refs/heads/trunk
Commit: 5ef94eb3ab775077d397466e289c5aa3e32477d0
Parents: da5f680
Author: Anthony Shaw 
Authored: Mon Oct 24 13:38:28 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:38:28 2016 +0100

--
 CHANGES.rst | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5ef94eb3/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 91fb33b..243416a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
 Compute
 ~~~
 
+- [digital ocean] add ex_hard_reboot in DigitalOcean_v2 driver
+  (GITHUB-920)
+  [Rick van de Loo]
+
 - [openstack] add ex_start_node for the openstack driver
   (GITHUB-919)
   [Rick van de Loo]



[1/3] libcloud git commit: changes for #919

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk 90a8673e8 -> 5ef94eb3a


changes for #919


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

Branch: refs/heads/trunk
Commit: 3a1928aca0ec1909910050192829abc1b979d830
Parents: 90a8673
Author: Anthony Shaw 
Authored: Mon Oct 24 13:36:58 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:36:58 2016 +0100

--
 CHANGES.rst | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/3a1928ac/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index bfb38a1..91fb33b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
 Compute
 ~~~
 
+- [openstack] add ex_start_node for the openstack driver
+  (GITHUB-919)
+  [Rick van de Loo]
+
 - [vultr] Extra Attributes for Node Creation on Vultr
   (GITHUB-917)
   [Fahri Cihan Demirci]



[GitHub] libcloud pull request #919: add ex_start_node for the openstack driver

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/919


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


libcloud git commit: add ex_start_node for the openstack driver

2016-10-24 Thread anthonyshaw
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 
Authored: Thu Oct 20 17:02:40 2016 +0200
Committer: Anthony Shaw 
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,



[GitHub] libcloud pull request #916: 0.20.1

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/916


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


libcloud git commit: closing spam Closes #916

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk d6ec89123 -> afc2d2822


closing spam
Closes #916


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

Branch: refs/heads/trunk
Commit: afc2d282281197f6193d6817ad917521f99f40e8
Parents: d6ec891
Author: Anthony Shaw 
Authored: Mon Oct 24 13:31:01 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:31:01 2016 +0100

--
 docs/other/hacktoberfest.txt | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/afc2d282/docs/other/hacktoberfest.txt
--
diff --git a/docs/other/hacktoberfest.txt b/docs/other/hacktoberfest.txt
index 8f18f37..97c54fa 100644
--- a/docs/other/hacktoberfest.txt
+++ b/docs/other/hacktoberfest.txt
@@ -9,3 +9,4 @@ Accounts raising spam pull requests as part of hacktoberfest:
 @go4st
 @ShyamW
 @lin31504
+@blusoul12
\ No newline at end of file



[jira] [Commented] (LIBCLOUD-864) Docker Driver install_image fails when parsing response

2016-10-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601841#comment-15601841
 ] 

ASF GitHub Bot commented on LIBCLOUD-864:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/918


> Docker Driver install_image fails when parsing response
> ---
>
> Key: LIBCLOUD-864
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-864
> Project: Libcloud
>  Issue Type: Bug
>Reporter: Pavlos Tzianos
>Priority: Minor
>  Labels: easyfix, newbie
>
> In previous version of the docker api when the install_image() method was 
> called, the response would be one json doc with a success or fail and the id 
> of the pulled image of the id. Now, in docker api 1.24 the entire sequence of 
> logs produced while pulling the image is returned in a chunked response. When 
> the DockerResponse.parse_body() is called it fails to parse this response and 
> an exception is thrown. Also, previously the id was returned in a field 
> called id, now the image id is returned in a field marked sha256.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LIBCLOUD-863) Vultr driver does not allow all attributes to be specified for server creation

2016-10-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601840#comment-15601840
 ] 

ASF GitHub Bot commented on LIBCLOUD-863:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/917


> Vultr driver does not allow all attributes to be specified for server creation
> --
>
> Key: LIBCLOUD-863
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-863
> Project: Libcloud
>  Issue Type: Improvement
>  Components: Compute
>Reporter: Fahri Cihan Demirci
>Priority: Minor
>
> Vultr compute driver does not allow specifying all extra attributes for a new 
> server creation. The attributes are listed here:
> https://www.vultr.com/api/#server_create



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] libcloud pull request #918: [LIBCLOUD-864] Fix Docker Driver install_image r...

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/918


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] libcloud pull request #917: [LIBCLOUD-863] Extra Attributes for Node Creatio...

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/917


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[5/5] libcloud git commit: changes for #918

2016-10-24 Thread anthonyshaw
changes for #918


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

Branch: refs/heads/trunk
Commit: d6ec8912350a71f0d22c633e1c0b64a8bb752262
Parents: d59e52c
Author: Anthony Shaw 
Authored: Mon Oct 24 13:29:36 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:29:36 2016 +0100

--
 CHANGES.rst | 11 +++
 1 file changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d6ec8912/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 4e5ae43..bfb38a1 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -37,6 +37,17 @@ Compute
   (GITHUB-856
   [Tom Melendez]
 
+Container
+~
+
+- [docker] As reported in the corresponding bug, the docker daemon will 
respond in an install_image call with all the messages
+  produced during the procedure parsed as json docs. In that case the response 
headers also contain the value 'transfer-encoding':'chunked'.
+  That kind of response can now be parsed properly by the DockerResponse 
parse_body method. Also, another small change is that previously
+  the id of the new image was marked in the json document as id, but now it's 
marked as sha256, so the regex used to discover the id
+  has been updated.
+  (GITHUB-918)
+  [Pavlos Tzianos]
+
 Storage
 ~~~
 



[4/5] libcloud git commit: Fix Docker Driver install_image response parsing and update test fixtures Closes #918

2016-10-24 Thread anthonyshaw
Fix Docker Driver install_image response parsing and update test fixtures
Closes #918


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

Branch: refs/heads/trunk
Commit: d59e52c3229808981a2d0e4d9a8eeb5ef78f5821
Parents: e263144
Author: ptzianos 
Authored: Thu Oct 20 15:49:20 2016 +0200
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:27:24 2016 +0100

--
 libcloud/container/drivers/docker.py|  28 ++-
 .../docker/linux_121/container_a68.json | 163 -
 .../fixtures/docker/linux_121/containers.json   | 143 ---
 .../docker/linux_121/create_container.json  |   4 -
 .../fixtures/docker/linux_121/create_image.json |   1 -
 .../fixtures/docker/linux_121/images.json   |  50 
 .../fixtures/docker/linux_121/logs.txt  |   1 -
 .../fixtures/docker/linux_121/search.json   | 202 
 .../fixtures/docker/linux_121/version.json  |  10 -
 .../docker/linux_124/container_a68.json | 163 +
 .../fixtures/docker/linux_124/containers.json   | 143 +++
 .../docker/linux_124/create_container.json  |   4 +
 .../fixtures/docker/linux_124/create_image.txt  | 238 +++
 .../fixtures/docker/linux_124/images.json   |  50 
 .../fixtures/docker/linux_124/logs.txt  |   1 +
 .../fixtures/docker/linux_124/search.json   | 202 
 .../fixtures/docker/linux_124/version.json  |  10 +
 .../fixtures/docker/mac_124/create_image.json   |   1 -
 .../fixtures/docker/mac_124/create_image.txt| 238 +++
 libcloud/test/container/test_docker.py  |  52 ++--
 20 files changed, 1094 insertions(+), 610 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d59e52c3/libcloud/container/drivers/docker.py
--
diff --git a/libcloud/container/drivers/docker.py 
b/libcloud/container/drivers/docker.py
index faf5117..ac5c0a1 100644
--- a/libcloud/container/drivers/docker.py
+++ b/libcloud/container/drivers/docker.py
@@ -54,7 +54,11 @@ class DockerResponse(JsonResponse):
 # an error, but response status could still be 200
 content_type = self.headers.get('content-type', 'application/json')
 if content_type == 'application/json' or content_type == '':
-body = json.loads(self.body)
+if self.headers.get('transfer-encoding') == 'chunked':
+body = [json.loads(chunk) for chunk in
+self.body.strip().replace('\r', '').split('\n')]
+else:
+body = json.loads(self.body)
 else:
 body = self.body
 except ValueError:
@@ -210,14 +214,20 @@ class DockerContainerDriver(ContainerDriver):
  method='POST')
 if "errorDetail" in result.body:
 raise DockerException(None, result.body)
-try:
-# get image id
-image_id = re.findall(
-r'{"status":"Download complete"'
-r',"progressDetail":{},"id":"\w+"}',
-result.body)[-1]
-image_id = json.loads(image_id).get('id')
-except:
+image_id = None
+
+# the response is slightly different if the image is already present
+# and it's not downloaded. both messages below indicate that the image
+# is available for use to the daemon
+if re.search(r'Downloaded newer image', result.body) or \
+re.search(r'"Status: Image is up to date', result.body):
+if re.search(r'sha256:(?P[a-z0-9]{64})', result.body):
+image_id = re.findall(r'sha256:(?P[a-z0-9]{64})',
+  result.body)[-1]
+
+# if there is a failure message or if there is not an image id in the
+# response then throw an exception.
+if image_id is None:
 raise DockerException(None, 'failed to install image')
 
 image = ContainerImage(

http://git-wip-us.apache.org/repos/asf/libcloud/blob/d59e52c3/libcloud/test/container/fixtures/docker/linux_121/container_a68.json
--
diff --git 
a/libcloud/test/container/fixtures/docker/linux_121/container_a68.json 
b/libcloud/test/container/fixtures/docker/linux_121/container_a68.json
deleted file mode 100644
index 88282ec..000
--- a/libcloud/test/container/fixtures/docker/linux_121/container_a68.json
+++ /dev/null
@@ -1,163 +0,0 @@
-{
-  

[2/5] libcloud git commit: changes for #917

2016-10-24 Thread anthonyshaw
changes for #917


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

Branch: refs/heads/trunk
Commit: e263144c4b1ff757510a71422214d8c974afbafb
Parents: 0664519
Author: Anthony Shaw 
Authored: Mon Oct 24 13:13:01 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:13:01 2016 +0100

--
 CHANGES.rst | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e263144c/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 2ef010e..4e5ae43 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
 Compute
 ~~~
 
+- [vultr] Extra Attributes for Node Creation on Vultr
+  (GITHUB-917)
+  [Fahri Cihan Demirci]
+
 - [vultr] Implement SSH Key Create/Delete Methods for Vultr
   (GITHUB-914)
   [Fahri Cihan Demirci]



[3/5] libcloud git commit: Fix Docker Driver install_image response parsing and update test fixtures Closes #918

2016-10-24 Thread anthonyshaw
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d59e52c3/libcloud/test/container/fixtures/docker/mac_124/create_image.txt
--
diff --git a/libcloud/test/container/fixtures/docker/mac_124/create_image.txt 
b/libcloud/test/container/fixtures/docker/mac_124/create_image.txt
new file mode 100644
index 000..942
--- /dev/null
+++ b/libcloud/test/container/fixtures/docker/mac_124/create_image.txt
@@ -0,0 +1,238 @@
+{"status":"Pulling from library/ubuntu","id":"12.04"}
+{"status":"Pulling fs layer","progressDetail":{},"id":"36cef014d5d4"}
+{"status":"Pulling fs layer","progressDetail":{},"id":"0d99ad4de1d2"}
+{"status":"Pulling fs layer","progressDetail":{},"id":"3e32dbf1ab94"}
+{"status":"Pulling fs layer","progressDetail":{},"id":"44710c456ffc"}
+{"status":"Pulling fs layer","progressDetail":{},"id":"56e70ac3b314"}
+{"status":"Waiting","progressDetail":{},"id":"44710c456ffc"}
+{"status":"Waiting","progressDetail":{},"id":"56e70ac3b314"}
+{"status":"Downloading","progressDetail":{"current":419,"total":419},"progress":"[==\u003e]
419 B/419 B","id":"3e32dbf1ab94"}
+{"status":"Verifying Checksum","progressDetail":{},"id":"3e32dbf1ab94"}
+{"status":"Download complete","progressDetail":{},"id":"3e32dbf1ab94"}
+{"status":"Downloading","progressDetail":{"current":16384,"total":57935},"progress":"[==\u003e
] 16.38 kB/57.94 kB","id":"0d99ad4de1d2"}
+{"status":"Downloading","progressDetail":{"current":32768,"total":57935},"progress":"[\u003e
  ] 32.77 kB/57.94 kB","id":"0d99ad4de1d2"}
+{"status":"Downloading","progressDetail":{"current":57935,"total":57935},"progress":"[==\u003e]
 57.94 kB/57.94 kB","id":"0d99ad4de1d2"}
+{"status":"Verifying Checksum","progressDetail":{},"id":"0d99ad4de1d2"}
+{"status":"Download complete","progressDetail":{},"id":"0d99ad4de1d2"}
+{"status":"Downloading","progressDetail":{"current":162,"total":162},"progress":"[==\u003e]
162 B/162 B","id":"56e70ac3b314"}
+{"status":"Verifying Checksum","progressDetail":{},"id":"56e70ac3b314"}
+{"status":"Download complete","progressDetail":{},"id":"56e70ac3b314"}
+{"status":"Downloading","progressDetail":{"current":682,"total":682},"progress":"[==\u003e]
682 B/682 B","id":"44710c456ffc"}
+{"status":"Verifying Checksum","progressDetail":{},"id":"44710c456ffc"}
+{"status":"Download complete","progressDetail":{},"id":"44710c456ffc"}
+{"status":"Downloading","progressDetail":{"current":392563,"total":39081844},"progress":"[\u003e
  ] 392.6 kB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":783955,"total":39081844},"progress":"[=\u003e
 ]   784 kB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":1178995,"total":39081844},"progress":"[=\u003e
 ] 1.179 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":1572211,"total":39081844},"progress":"[==\u003e
] 1.572 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":1965427,"total":39081844},"progress":"[==\u003e
] 1.965 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":2358643,"total":39081844},"progress":"[===\u003e
   ] 2.359 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":2751859,"total":39081844},"progress":"[===\u003e
   ] 2.752 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":3145075,"total":39081844},"progress":"[\u003e
  ] 3.145 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":3538291,"total":39081844},"progress":"[\u003e
  ] 3.538 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":3931507,"total":39081844},"progress":"[=\u003e
 ] 3.932 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":4324723,"total":39081844},"progress":"[=\u003e
 ] 4.325 MB/39.08 
MB","id":"36cef014d5d4"}
+{"status":"Downloading","progressDetail":{"current":4717939,"total":39081844},"progress":"[==\u003e
] 4.718 MB/39.08 

[1/5] libcloud git commit: Extra Attributes for Node Creation on Vultr Closes #917 * Add extra attributes for specifying node creation parameters with the Vultr driver. * Add a simple test for node cr

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk e20f53699 -> d6ec89123


Extra Attributes for Node Creation on Vultr
Closes #917
* Add extra attributes for specifying node creation parameters with the Vultr
  driver.
* Add a simple test for node creation on Vultr.


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

Branch: refs/heads/trunk
Commit: 0664519fde98c7b9a194729a0d3bc86d80922c88
Parents: e20f536
Author: Fahri Cihan Demirci 
Authored: Wed Oct 19 16:01:31 2016 -0400
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:12:20 2016 +0100

--
 libcloud/compute/drivers/vultr.py   | 84 +++-
 .../compute/fixtures/vultr/create_node.json |  3 +
 libcloud/test/compute/test_vultr.py | 12 +++
 3 files changed, 98 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0664519f/libcloud/compute/drivers/vultr.py
--
diff --git a/libcloud/compute/drivers/vultr.py 
b/libcloud/compute/drivers/vultr.py
index 5b0d990..0313144 100644
--- a/libcloud/compute/drivers/vultr.py
+++ b/libcloud/compute/drivers/vultr.py
@@ -93,6 +93,26 @@ class VultrNodeDriver(NodeDriver):
 NODE_STATE_MAP = {'pending': NodeState.PENDING,
   'active': NodeState.RUNNING}
 
+EX_CREATE_YES_NO_ATTRIBUTES = ['enable_ipv6',
+   'enable_private_network',
+   'auto_backups',
+   'notify_activate',
+   'ddos_protection']
+
+EX_CREATE_ID_ATTRIBUTES = {'iso_id': 'ISOID',
+   'script_id': 'SCRIPTID',
+   'snapshot_id': 'SNAPSHOTID',
+   'app_id': 'APPID'}
+
+EX_CREATE_ATTRIBUTES = ['ipxe_chain_url',
+'label',
+'userdata',
+'reserved_ip_v4',
+'hostname',
+'tag']
+EX_CREATE_ATTRIBUTES.extend(EX_CREATE_YES_NO_ATTRIBUTES)
+EX_CREATE_ATTRIBUTES.extend(EX_CREATE_ID_ATTRIBUTES.keys())
+
 def list_nodes(self):
 return self._list_resources('/v1/server/list', self._to_node)
 
@@ -142,13 +162,75 @@ class VultrNodeDriver(NodeDriver):
 def list_images(self):
 return self._list_resources('/v1/os/list', self._to_image)
 
-def create_node(self, name, size, image, location, ex_ssh_key_ids=None):
+def create_node(self, name, size, image, location, ex_ssh_key_ids=None,
+ex_create_attr=None):
+"""
+Create a node
+
+:param name: Name for the new node
+:type name: ``str``
+
+:param size: Size of the new node
+:type size: :class:`NodeSize`
+
+:param image: Image for the new node
+:type image: :class:`NodeImage`
+
+:param location: Location of the new node
+:type location: :class:`NodeLocation`
+
+:param ex_ssh_key_ids: IDs of the SSH keys to initialize
+:type ex_sshkeyid: ``list`` of ``str``
+
+:param ex_create_attr: Extra attributes for node creation
+:type ex_create_attr: ``dict``
+
+The `ex_create_attr` parameter can include the following dictionary
+key and value pairs:
+
+* `ipxe_chain_url`: ``str`` for specifying URL to boot via IPXE
+* `iso_id`: ``str`` the ID of a specific ISO to mount,
+  only meaningful with the `Custom` `NodeImage`
+* `script_id`: ``int`` ID of a startup script to execute on boot,
+  only meaningful when the `NodeImage` is not `Custom`
+* 'snapshot_id`: ``str`` Snapshot ID to restore for the initial
+  installation, only meaningful with the `Snapshot` `NodeImage`
+* `enable_ipv6`: ``bool`` Whether an IPv6 subnet should be assigned
+* `enable_private_network`: ``bool`` Whether private networking
+  support should be added
+* `label`: ``str`` Text label to be shown in the control panel
+* `auto_backups`: ``bool`` Whether automatic backups should be enabled
+* `app_id`: ``int`` App ID to launch if launching an application,
+  only meaningful when the `NodeImage` is `Application`
+* `userdata`: ``str`` Base64 encoded cloud-init user-data
+* `notify_activate`: ``bool`` Whether an activation email should be
+  sent when the server is ready
+* `ddos_protection`: ``bool`` Whether DDOS protection 

[GitHub] libcloud pull request #915: Fixed typo

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/915


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


libcloud git commit: Fixed typo Closes #915

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk bdea59925 -> e20f53699


Fixed typo
Closes #915


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

Branch: refs/heads/trunk
Commit: e20f5369988538a94a89c329a6f79af5fcf8d730
Parents: bdea599
Author: Samuel Marks 
Authored: Wed Oct 19 17:46:38 2016 +1100
Committer: Anthony Shaw 
Committed: Mon Oct 24 13:06:31 2016 +0100

--
 CHANGES.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e20f5369/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 16cd5c2..2ef010e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -114,7 +114,7 @@ Compute
 Container
 ~
 
-- Introduced new Racher driver
+- Introduced new Rancher driver
   (GITHUB-876)
   [Mario Loria]
 



[jira] [Commented] (LIBCLOUD-862) Vultr driver does not implement SSH key create and delete methods

2016-10-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601661#comment-15601661
 ] 

ASF GitHub Bot commented on LIBCLOUD-862:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/914


> Vultr driver does not implement SSH key create and delete methods
> -
>
> Key: LIBCLOUD-862
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-862
> Project: Libcloud
>  Issue Type: New Feature
>  Components: Compute
>Reporter: Fahri Cihan Demirci
>Priority: Minor
>
> The Vultr compute driver is not implementing SSH key create and delete 
> methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/2] libcloud git commit: [LIBCLOUD-862] Implement SSH Key Create/Delete Methods for Vultr

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk e772a8b01 -> bdea59925


[LIBCLOUD-862] Implement SSH Key Create/Delete Methods for Vultr

* Add methods to the Vultr compute driver for creating and deleting SSH key
  pairs.
* Add the corresponding tests for the Vultr compute driver test suite.


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

Branch: refs/heads/trunk
Commit: 5c6cc2f36f11ca78a50ee357c5b58acc2fdb0183
Parents: c2edb00
Author: Fahri Cihan Demirci 
Authored: Sun Oct 16 07:16:41 2016 -0400
Committer: Fahri Cihan Demirci 
Committed: Tue Oct 18 21:45:19 2016 -0400

--
 libcloud/compute/drivers/vultr.py   | 29 
 .../compute/fixtures/vultr/create_key_pair.json |  3 ++
 .../compute/fixtures/vultr/list_key_pairs.json  |  8 ++
 libcloud/test/compute/test_vultr.py | 28 +++
 4 files changed, 68 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c6cc2f3/libcloud/compute/drivers/vultr.py
--
diff --git a/libcloud/compute/drivers/vultr.py 
b/libcloud/compute/drivers/vultr.py
index 3823119..5b0d990 100644
--- a/libcloud/compute/drivers/vultr.py
+++ b/libcloud/compute/drivers/vultr.py
@@ -104,6 +104,35 @@ class VultrNodeDriver(NodeDriver):
 """
 return self._list_resources('/v1/sshkey/list', self._to_ssh_key)
 
+def create_key_pair(self, name, public_key=''):
+"""
+Create a new SSH key.
+:param name: Name of the new SSH key
+:type name: ``str``
+
+:key public_key: Public part of the new SSH key
+:type name: ``str``
+
+:return: True on success
+:rtype: ``bool``
+"""
+params = {'name': name, 'ssh_key': public_key}
+res = self.connection.post('/v1/sshkey/create', params)
+return res.status == httplib.OK
+
+def delete_key_pair(self, key_pair):
+"""
+Delete an SSH key.
+:param key_pair: The SSH key to delete
+:type key_pair: :class:`SSHKey`
+
+:return: True on success
+:rtype: ``bool``
+"""
+params = {'SSHKEYID': key_pair.id}
+res = self.connection.post('/v1/sshkey/destroy', params)
+return res.status == httplib.OK
+
 def list_locations(self):
 return self._list_resources('/v1/regions/list', self._to_location)
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c6cc2f3/libcloud/test/compute/fixtures/vultr/create_key_pair.json
--
diff --git a/libcloud/test/compute/fixtures/vultr/create_key_pair.json 
b/libcloud/test/compute/fixtures/vultr/create_key_pair.json
new file mode 100644
index 000..f43bc0a
--- /dev/null
+++ b/libcloud/test/compute/fixtures/vultr/create_key_pair.json
@@ -0,0 +1,3 @@
+{
+"SSHKEYID": "5806ab4970aba"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c6cc2f3/libcloud/test/compute/fixtures/vultr/list_key_pairs.json
--
diff --git a/libcloud/test/compute/fixtures/vultr/list_key_pairs.json 
b/libcloud/test/compute/fixtures/vultr/list_key_pairs.json
new file mode 100644
index 000..b8d5cad
--- /dev/null
+++ b/libcloud/test/compute/fixtures/vultr/list_key_pairs.json
@@ -0,0 +1,8 @@
+{
+"5806a8ef2a0c6": {
+"SSHKEYID": "5806a8ef2a0c6",
+"date_created": "2016-10-18 18:57:51",
+"name": "test-key-pair",
+"ssh_key": "ssh-rsa 
B3NzaC1yc2EDAQABAAABAQDZYMivN4KqJZ3dNEWeH20PUeB2ZnZRkk91K5SgxWrEotgpX4pMVM/9oxkh4bKw5CBzT6KAOghzLcBViFpNVjDyyet9wwVcy6cjuUynx63UtbTLB+r4D+bD/+/9rQTeckvGYg9Y8xIKL/oaVeCcdBM8JhSQZbZ/aARi2K79FWGH61azAqc/JCHT63f3FhspjdVpcVoVOjsZG3WG6Vymys2cXH1PM5qMgBbmp+5LkSv0LvUULyxcrtKkUyntPr1BvIFSNbo2lhXLwnM4DXONP6U/yMFte+ZwiajF7pUCdB9HqvXVU+IfswYSDuhHzL9j8+ZLQ2enF/lkkYxpMHE2t215
 tester@test"
+}
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5c6cc2f3/libcloud/test/compute/test_vultr.py
--
diff --git a/libcloud/test/compute/test_vultr.py 
b/libcloud/test/compute/test_vultr.py
index 066cc86..538e62f 100644
--- a/libcloud/test/compute/test_vultr.py
+++ b/libcloud/test/compute/test_vultr.py
@@ -84,6 +84,23 @@ class VultrTests(LibcloudTestCase):
 result = self.driver.destroy_node(node)
 self.assertTrue(result)
 
+def test_list_key_pairs_success(self):
+key_pairs = self.driver.list_key_pairs()
+

[jira] [Commented] (LIBCLOUD-862) Vultr driver does not implement SSH key create and delete methods

2016-10-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601660#comment-15601660
 ] 

ASF subversion and git services commented on LIBCLOUD-862:
--

Commit 5c6cc2f36f11ca78a50ee357c5b58acc2fdb0183 in libcloud's branch 
refs/heads/trunk from [~femnad]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=5c6cc2f ]

[LIBCLOUD-862] Implement SSH Key Create/Delete Methods for Vultr

* Add methods to the Vultr compute driver for creating and deleting SSH key
  pairs.
* Add the corresponding tests for the Vultr compute driver test suite.


> Vultr driver does not implement SSH key create and delete methods
> -
>
> Key: LIBCLOUD-862
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-862
> Project: Libcloud
>  Issue Type: New Feature
>  Components: Compute
>Reporter: Fahri Cihan Demirci
>Priority: Minor
>
> The Vultr compute driver is not implementing SSH key create and delete 
> methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/2] libcloud git commit: changes for #914

2016-10-24 Thread anthonyshaw
changes for #914


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

Branch: refs/heads/trunk
Commit: bdea599252625d31574c60b00483cdc509bd10b4
Parents: e772a8b 5c6cc2f
Author: Anthony Shaw 
Authored: Mon Oct 24 12:08:42 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 12:08:42 2016 +0100

--
 CHANGES.rst |  4 +++
 libcloud/compute/drivers/vultr.py   | 29 
 .../compute/fixtures/vultr/create_key_pair.json |  3 ++
 .../compute/fixtures/vultr/list_key_pairs.json  |  8 ++
 libcloud/test/compute/test_vultr.py | 28 +++
 5 files changed, 72 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/bdea5992/CHANGES.rst
--
diff --cc CHANGES.rst
index 1818914,17f42d6..16cd5c2
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@@ -8,19 -8,6 +8,23 @@@ Changes in current version of Apache Li
  Compute
  ~~~
  
++- [vultr] Implement SSH Key Create/Delete Methods for Vultr
++  (GITHUB-914)
++  [Fahri Cihan Demirci]
++
 +- [dimension data] No longer throw error when powering off a node that is 
already stopped.
 +  (GITHUB-912)
 +  [Samuel Chong]
 +
 +- [dimension data] Refactor create_node for MCP2 to support CaaS API 2.3 
feature.
 +  Can now specify Network Adapter Name for primary and additional NIC. 
Parameters in create_node function is tailored for MCP2.
 +  (GITHUB-902)
 +  [Samuel Chong]
 +
 +- Volume snapshot operations, i.e. creating, listing and deleting volume 
snapshots, for the Digital Ocean driver.
 +  (LIBCLOUD-861, GITHUB-909)
 +  [Fahri Cihan Demirci]
 +
  - Added snapshot management to OVH compute
(GITHUB-897)
[Anthony Monthe]



libcloud git commit: changes for #912

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk ebbacff26 -> e772a8b01


changes for #912


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

Branch: refs/heads/trunk
Commit: e772a8b0196ac569e1d47383c1f3ed713d5d3b62
Parents: ebbacff
Author: Anthony Shaw 
Authored: Mon Oct 24 12:06:48 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 12:06:48 2016 +0100

--
 CHANGES.rst | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e772a8b0/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 6857592..1818914 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
 Compute
 ~~~
 
+- [dimension data] No longer throw error when powering off a node that is 
already stopped.
+  (GITHUB-912)
+  [Samuel Chong]
+
 - [dimension data] Refactor create_node for MCP2 to support CaaS API 2.3 
feature.
   Can now specify Network Adapter Name for primary and additional NIC. 
Parameters in create_node function is tailored for MCP2.
   (GITHUB-902)



[6/8] libcloud git commit: Add back parenthesis to safe guard format string in the future.

2016-10-24 Thread anthonyshaw
Add back parenthesis to safe guard format string in the future.


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

Branch: refs/heads/trunk
Commit: 64793fdf65d5f77d3e0b6badc71565e552190190
Parents: d179018
Author: Samuel Chong 
Authored: Fri Oct 21 10:56:29 2016 +1100
Committer: Samuel Chong 
Committed: Fri Oct 21 10:56:29 2016 +1100

--
 libcloud/common/dimensiondata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/64793fdf/libcloud/common/dimensiondata.py
--
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 8eb5446..33a1221 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -563,7 +563,7 @@ class DimensionDataConnection(ConnectionUserAndKey):
 sleep(poll_interval)
 cnt += 1
 
-msg = 'Status check for object %s timed out' % result
+msg = 'Status check for object %s timed out' % (result)
 raise DimensionDataAPIException(code=object_state,
 msg=msg,
 driver=self.driver)



[GitHub] libcloud pull request #912: DimensionData - Handle exception when powering o...

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/912


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/8] libcloud git commit: Merge remote-tracking branch 'apache/trunk' into enhance_get_resource_state

2016-10-24 Thread anthonyshaw
Merge remote-tracking branch 'apache/trunk' into enhance_get_resource_state


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

Branch: refs/heads/trunk
Commit: a6e45436961be976a4075f305240fe91874e6d98
Parents: 1f1233b e4e56e9
Author: Samuel Chong 
Authored: Mon Oct 17 10:52:00 2016 +1100
Committer: Samuel Chong 
Committed: Mon Oct 17 10:52:00 2016 +1100

--
 doap_libcloud.rdf   |   7 ++
 docs/compute/index.rst  |   2 +-
 docs/other/hacktoberfest.txt|   1 +
 libcloud/compute/drivers/dimensiondata.py   |   2 +-
 libcloud/container/drivers/rancher.py   |  33 +++---
 .../fixtures/dimensiondata/audit_log.csv|  25 +
 libcloud/test/compute/test_dimensiondata.py |  12 ++
 .../fixtures/rancher/start_container.json   | 109 +++
 libcloud/test/container/test_rancher.py |   9 ++
 9 files changed, 180 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a6e45436/libcloud/compute/drivers/dimensiondata.py
--



[3/8] libcloud git commit: Fixed response code missing single quote

2016-10-24 Thread anthonyshaw
Fixed response code missing single quote


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

Branch: refs/heads/trunk
Commit: e04cbe61262c9f2c3c277f0309d1d2b77ebec0cf
Parents: a6e4543
Author: Samuel Chong 
Authored: Mon Oct 17 11:18:11 2016 +1100
Committer: Samuel Chong 
Committed: Mon Oct 17 11:18:11 2016 +1100

--
 libcloud/compute/drivers/dimensiondata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e04cbe61/libcloud/compute/drivers/dimensiondata.py
--
diff --git a/libcloud/compute/drivers/dimensiondata.py 
b/libcloud/compute/drivers/dimensiondata.py
index fb90aca..bc8d565 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -657,7 +657,7 @@ class DimensionDataNodeDriver(NodeDriver):
 if r is not None:
 response_code = r.state.upper()
 pass
-return response_code in ['IN_PROGRESS', 'OK', 'STOPPED, STOPPING']
+return response_code in ['IN_PROGRESS', 'OK', 'STOPPED', 'STOPPING']
 
 def ex_reset(self, node):
 """



[5/8] libcloud git commit: Fixed exception handling for powering off node

2016-10-24 Thread anthonyshaw
Fixed exception handling for powering off node


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

Branch: refs/heads/trunk
Commit: d17901893f875d7c6c9aefbaea9f354e54bfd050
Parents: 50e9a57
Author: Samuel Chong 
Authored: Mon Oct 17 14:08:10 2016 +1100
Committer: Samuel Chong 
Committed: Mon Oct 17 14:08:10 2016 +1100

--
 libcloud/compute/drivers/dimensiondata.py   | 13 ++-
 .../fixtures/dimensiondata/server_GetServer.xml | 39 
 libcloud/test/compute/test_dimensiondata.py |  8 +++-
 3 files changed, 49 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d1790189/libcloud/compute/drivers/dimensiondata.py
--
diff --git a/libcloud/compute/drivers/dimensiondata.py 
b/libcloud/compute/drivers/dimensiondata.py
index bc8d565..0546ec3 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -640,8 +640,6 @@ class DimensionDataNodeDriver(NodeDriver):
 request_elm = ET.Element('powerOffServer',
  {'xmlns': TYPES_URN, 'id': node.id})
 
-response_code = None
-
 try:
 body = self.connection.request_with_orgId_api_2(
 'server/powerOffServer',
@@ -649,14 +647,9 @@ class DimensionDataNodeDriver(NodeDriver):
 data=ET.tostring(request_elm)).object
 response_code = findtext(body, 'responseCode', TYPES_URN)
 except (DimensionDataAPIException, NameError, BaseHTTPError):
-r = self.ex_wait_for_state(
-state='stopped',
-func=self.ex_get_node_by_id,
-id=node.id,
-timeout=1)
-if r is not None:
-response_code = r.state.upper()
-pass
+r = self.ex_get_node_by_id(node.id)
+response_code = r.state.upper()
+
 return response_code in ['IN_PROGRESS', 'OK', 'STOPPED', 'STOPPING']
 
 def ex_reset(self, node):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/d1790189/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml
--
diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml 
b/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml
new file mode 100644
index 000..fc71562
--- /dev/null
+++ b/libcloud/test/compute/fixtures/dimensiondata/server_GetServer.xml
@@ -0,0 +1,39 @@
+
+
+Production Web Server
+Server to host our main web application.
+
+
+4
+
+
+
+
+
+
+MSSQL2008R2S
+3ebf3c0f-90fe-4a8b-8585-6e65b316592c
+2015-12-02T10:31:33.000Z
+true
+true
+stopped
+
+SHUTDOWN_SERVER
+2015-12-02T11:07:40.000Z
+devuser1
+
+
+ 
+
+**OR**
+
+

http://git-wip-us.apache.org/repos/asf/libcloud/blob/d1790189/libcloud/test/compute/test_dimensiondata.py
--
diff --git a/libcloud/test/compute/test_dimensiondata.py 
b/libcloud/test/compute/test_dimensiondata.py
index 80dfa4a..7ea0d1e 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -515,8 +515,9 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 
 def test_ex_power_off_INPROGRESS(self):
 DimensionDataMockHttp.type = 'INPROGRESS'
-node = Node(id='11', name=None, state=None,
+node = Node(id='11', name=None, state='STOPPING',
 public_ips=None, private_ips=None, driver=self.driver)
+
 with self.assertRaises(DimensionDataAPIException):
 self.driver.ex_power_off(node)
 
@@ -2183,6 +2184,11 @@ class DimensionDataMockHttp(StorageMockHttp, MockHttp):
 'server_powerOffServer_INPROGRESS.xml')
 return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK])
 
+def 
_caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_11_INPROGRESS(
+self, method, url, body, headers):
+body = self.fixtures.load('server_GetServer.xml')
+return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK])
+
 def 
_caas_2_3_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain(self, 
method, url, body, headers):
 body = self.fixtures.load(
 'network_networkDomain.xml')



[4/8] libcloud git commit: fix unit test

2016-10-24 Thread anthonyshaw
fix unit test


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

Branch: refs/heads/trunk
Commit: 50e9a57e4071f04ff9bd2485f7f8248a87e4c8de
Parents: e04cbe6
Author: Samuel Chong 
Authored: Mon Oct 17 11:35:34 2016 +1100
Committer: Samuel Chong 
Committed: Mon Oct 17 11:35:34 2016 +1100

--
 libcloud/common/dimensiondata.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/50e9a57e/libcloud/common/dimensiondata.py
--
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 84bca0d..8eb5446 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -549,6 +549,8 @@ class DimensionDataConnection(ConnectionUserAndKey):
 :return: Result from the calling function.
 """
 cnt = 0
+result = None
+object_state = None
 while cnt < timeout / poll_interval:
 result = func(*args, **kwargs)
 if isinstance(result, Node):
@@ -561,7 +563,7 @@ class DimensionDataConnection(ConnectionUserAndKey):
 sleep(poll_interval)
 cnt += 1
 
-msg = 'Status check for object %s timed out' % (result)
+msg = 'Status check for object %s timed out' % result
 raise DimensionDataAPIException(code=object_state,
 msg=msg,
 driver=self.driver)



[jira] [Commented] (LIBCLOUD-861) Volume snapshot operations are not implemented for Digital Ocean driver

2016-10-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601644#comment-15601644
 ] 

ASF GitHub Bot commented on LIBCLOUD-861:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/909


> Volume snapshot operations are not implemented for Digital Ocean driver
> ---
>
> Key: LIBCLOUD-861
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-861
> Project: Libcloud
>  Issue Type: New Feature
>  Components: Compute
>Reporter: Fahri Cihan Demirci
>Priority: Minor
>
> For the Digital Ocean driver, volume snapshot operations, like creating 
> snapshots for volumes, listing volume snapshots and deleting volume 
> snapshots, have not been implemented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LIBCLOUD-861) Volume snapshot operations are not implemented for Digital Ocean driver

2016-10-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15601643#comment-15601643
 ] 

ASF subversion and git services commented on LIBCLOUD-861:
--

Commit 8c5a4aff28c1f0eb7b7229558f2e88b83691df73 in libcloud's branch 
refs/heads/trunk from [~femnad]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=8c5a4af ]

LIBCLOUD-861: Implement Volume Snapshot Operations for Digital Ocean

* Add methods for creating, listing and deleting volume snapshots to the
  Digital Ocean driver.
* Add the corresponding tests and their fixtures.


> Volume snapshot operations are not implemented for Digital Ocean driver
> ---
>
> Key: LIBCLOUD-861
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-861
> Project: Libcloud
>  Issue Type: New Feature
>  Components: Compute
>Reporter: Fahri Cihan Demirci
>Priority: Minor
>
> For the Digital Ocean driver, volume snapshot operations, like creating 
> snapshots for volumes, listing volume snapshots and deleting volume 
> snapshots, have not been implemented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] libcloud pull request #909: LIBCLOUD-861: Implement Volume Snapshot Operatio...

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/909


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[1/2] libcloud git commit: LIBCLOUD-861: Implement Volume Snapshot Operations for Digital Ocean

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk e62eb2bcc -> 50cba636e


LIBCLOUD-861: Implement Volume Snapshot Operations for Digital Ocean

* Add methods for creating, listing and deleting volume snapshots to the
  Digital Ocean driver.
* Add the corresponding tests and their fixtures.


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

Branch: refs/heads/trunk
Commit: 8c5a4aff28c1f0eb7b7229558f2e88b83691df73
Parents: e4e56e9
Author: Fahri Cihan Demirci 
Authored: Sat Oct 15 05:17:41 2016 -0400
Committer: Fahri Cihan Demirci 
Committed: Sun Oct 16 00:08:15 2016 -0400

--
 libcloud/compute/drivers/digitalocean.py| 54 +++-
 .../digitalocean_v2/create_volume_snapshot.json | 14 +
 .../digitalocean_v2/list_volume_snapshots.json  | 44 
 libcloud/test/compute/test_digitalocean_v2.py   | 40 +++
 4 files changed, 151 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8c5a4aff/libcloud/compute/drivers/digitalocean.py
--
diff --git a/libcloud/compute/drivers/digitalocean.py 
b/libcloud/compute/drivers/digitalocean.py
index b195bae..7a676b6 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -27,7 +27,7 @@ from libcloud.common.types import InvalidCredsError
 from libcloud.compute.types import Provider, NodeState
 from libcloud.compute.base import NodeImage, NodeSize, NodeLocation, KeyPair
 from libcloud.compute.base import Node, NodeDriver
-from libcloud.compute.base import StorageVolume
+from libcloud.compute.base import StorageVolume, VolumeSnapshot
 
 __all__ = [
 'DigitalOceanNodeDriver',
@@ -398,6 +398,49 @@ class 
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
 
 return all([r.status == httplib.ACCEPTED for r in responses])
 
+def create_volume_snapshot(self, volume, name):
+"""
+Create a new volume snapshot.
+
+:param volume: Volume to create a snapshot for
+:type volume: class:`StorageVolume`
+
+:return: The newly created volume snapshot.
+:rtype: :class:`VolumeSnapshot`
+"""
+attr = {'name': name}
+res = self.connection.request('/v2/volumes/%s/snapshots' % (
+volume.id), data=json.dumps(attr), method='POST')
+data = res.object['snapshot']
+return self._to_volume_snapshot(data=data)
+
+def list_volume_snapshots(self, volume):
+"""
+List snapshots for a volume.
+
+:param volume: Volume to list snapshots for
+:type volume: class:`StorageVolume`
+
+:return: List of volume snapshots.
+:rtype: ``list`` of :class: `StorageVolume`
+"""
+data = self._paginated_request('/v2/volumes/%s/snapshots' %
+   (volume.id), 'snapshots')
+return list(map(self._to_volume_snapshot, data))
+
+def delete_volume_snapshot(self, snapshot):
+"""
+Delete a volume snapshot
+
+:param snapshot: volume snapshot to delete
+:type snapshot: class:`VolumeSnapshot`
+
+:rtype: ``bool``
+"""
+res = self.connection.request('v2/snapshots/%s' % (snapshot.id),
+  method='DELETE')
+return res.status == httplib.NO_CONTENT
+
 def _to_node(self, data):
 extra_keys = ['memory', 'vcpus', 'disk', 'region', 'image',
   'size_slug', 'locked', 'created_at', 'networks',
@@ -467,3 +510,12 @@ class 
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
private_key=None,
driver=self,
extra=extra)
+
+def _to_volume_snapshot(self, data):
+extra = {'created_at': data['created_at'],
+ 'resource_id': data['resource_id'],
+ 'regions': data['regions'],
+ 'min_disk_size': data['min_disk_size']}
+return VolumeSnapshot(id=data['id'], name=data['name'],
+  size=data['size_gigabytes'],
+  driver=self, extra=extra)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/8c5a4aff/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json
--
diff --git 
a/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json 
b/libcloud/test/compute/fixtures/digitalocean_v2/create_volume_snapshot.json

[2/2] libcloud git commit: Merge branch 'github-909' into trunk Closes #909

2016-10-24 Thread anthonyshaw
Merge branch 'github-909' into trunk
Closes #909


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

Branch: refs/heads/trunk
Commit: 50cba636ede0bf412bdfcefa74a8f606bb097f9c
Parents: e62eb2b 8c5a4af
Author: Anthony Shaw 
Authored: Mon Oct 24 12:00:08 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 12:00:08 2016 +0100

--
 libcloud/compute/drivers/digitalocean.py| 54 +++-
 .../digitalocean_v2/create_volume_snapshot.json | 14 +
 .../digitalocean_v2/list_volume_snapshots.json  | 44 
 libcloud/test/compute/test_digitalocean_v2.py   | 40 +++
 4 files changed, 151 insertions(+), 1 deletion(-)
--




[GitHub] libcloud pull request #902: Refactor DimensionData Create node to support MC...

2016-10-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/902


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/5] libcloud git commit: Remove unnecessary comment

2016-10-24 Thread anthonyshaw
Remove unnecessary comment


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

Branch: refs/heads/trunk
Commit: 278c6355623f664ccf9ae9c9bd9b64a1df716753
Parents: 95d1001
Author: Samuel Chong 
Authored: Tue Oct 11 12:00:46 2016 +1100
Committer: Samuel Chong 
Committed: Tue Oct 11 12:00:46 2016 +1100

--
 libcloud/compute/drivers/dimensiondata.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/278c6355/libcloud/compute/drivers/dimensiondata.py
--
diff --git a/libcloud/compute/drivers/dimensiondata.py 
b/libcloud/compute/drivers/dimensiondata.py
index 8d19022..c0e1589 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -316,8 +316,7 @@ class DimensionDataNodeDriver(NodeDriver):
 >>> # Get dimension data driver
 >>> libcloud.security.VERIFY_SSL_CERT = True
 >>> cls = get_driver(Provider.DIMENSIONDATA)
->>> driver = cls('schong_platcaas', 'T3stst@r!', region='dd-au')
->>> # driver = cls('myusername','mypassword', region='dd-au')
+>>> driver = cls('myusername','mypassword', region='dd-au')
 >>>
 >>> # Password
 >>> root_pw = NodeAuthPassword('password123')



[4/5] libcloud git commit: Fix lint error

2016-10-24 Thread anthonyshaw
Fix lint error


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

Branch: refs/heads/trunk
Commit: fc9c3960c173f3ed7fcabcac1e7b0c6d5ffed6cd
Parents: 81829b4
Author: Samuel Chong 
Authored: Thu Oct 13 11:37:42 2016 +1100
Committer: Samuel Chong 
Committed: Thu Oct 13 11:37:42 2016 +1100

--
 libcloud/compute/drivers/dimensiondata.py   |  7 ---
 libcloud/test/compute/test_dimensiondata.py | 24 ++--
 2 files changed, 6 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fc9c3960/libcloud/compute/drivers/dimensiondata.py
--
diff --git a/libcloud/compute/drivers/dimensiondata.py 
b/libcloud/compute/drivers/dimensiondata.py
index 7cb197f..0381fb5 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -298,7 +298,8 @@ class DimensionDataNodeDriver(NodeDriver):
 >>> images = driver.list_images(location=location)
 >>> image = images[0]
 >>>
->>> node = driver.create_node(name='test_blah_2', image=image, 
auth=root_pw,
+>>> node = driver.create_node(name='test_blah_2', image=image,
+>>>   auth=root_pw,
 >>>   ex_description='test3 node',
 >>>   ex_network=my_network,
 >>>   ex_is_started=False)
@@ -603,13 +604,13 @@ class DimensionDataNodeDriver(NodeDriver):
'additionalNic')
 
 if (nic.private_ip_v4 is None and
-nic.vlan is None):
+nic.vlan is None):
 raise ValueError("Either a vlan or private_ip_v4 "
  "must be specified for each "
  "additional nic.")
 
 if (nic.private_ip_v4 is not None and
-nic.vlan is not None):
+nic.vlan is not None):
 raise ValueError("Either a vlan or private_ip_v4 "
  "must be specified for each "
  "additional nic. Not both.")

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fc9c3960/libcloud/test/compute/test_dimensiondata.py
--
diff --git a/libcloud/test/compute/test_dimensiondata.py 
b/libcloud/test/compute/test_dimensiondata.py
index d6376a4..d6bf345 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -236,16 +236,6 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 self.assertEqual(images[0].extra['cpu'].cpu_count, 4)
 self.assertEqual(images[0].extra['OS_displayName'], 'REDHAT6/64')
 
-def test_create_node_response(self):
-rootPw = NodeAuthPassword('pass123')
-image = self.driver.list_images()[0]
-network = self.driver.ex_list_networks()[0]
-node = self.driver.create_node(name='test2', image=image, auth=rootPw,
-   ex_description='test2 node', 
ex_network=network,
-   ex_is_started=False)
-self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
-self.assertEqual(node.extra['status'].action, 'DEPLOY_SERVER')
-
 def test_create_mcp1_node_optional_param(self):
 root_pw = NodeAuthPassword('pass123')
 image = self.driver.list_images()[0]
@@ -271,7 +261,8 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 image = self.driver.list_images()[0]
 network = self.driver.ex_list_networks()[0]
 node = self.driver.create_node(name='test2', image=image, auth=None,
-   ex_description='test2 node', 
ex_network=network,
+   ex_description='test2 node',
+   ex_network=network,
ex_is_started=False)
 self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 self.assertEqual(node.extra['status'].action, 'DEPLOY_SERVER')
@@ -646,17 +637,6 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 self.assertEqual(node.id, 'e75ead52-692f-4314-8725-c8a4f4d13a87')
 self.assertEqual(node.extra['status'].action, 

[5/5] libcloud git commit: Merge branch 'github-902' into trunk Closes #902

2016-10-24 Thread anthonyshaw
Merge branch 'github-902' into trunk
Closes #902


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

Branch: refs/heads/trunk
Commit: e62eb2bcc17240fc1b65592c1a83134b61fa841e
Parents: c2edb00 fc9c396
Author: Anthony Shaw 
Authored: Mon Oct 24 11:51:41 2016 +0100
Committer: Anthony Shaw 
Committed: Mon Oct 24 11:51:41 2016 +0100

--
 libcloud/common/dimensiondata.py|   3 +-
 libcloud/compute/drivers/dimensiondata.py   | 579 ++-
 libcloud/test/compute/test_dimensiondata.py | 316 -
 3 files changed, 768 insertions(+), 130 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e62eb2bc/libcloud/compute/drivers/dimensiondata.py
--

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e62eb2bc/libcloud/test/compute/test_dimensiondata.py
--



[3/5] libcloud git commit: Merge remote-tracking branch 'apache/trunk' into create_node_mcp2

2016-10-24 Thread anthonyshaw
Merge remote-tracking branch 'apache/trunk' into create_node_mcp2


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

Branch: refs/heads/trunk
Commit: 81829b47cd61eb0050ebb15ef49391c3101384ae
Parents: 278c635 065d191
Author: Samuel Chong 
Authored: Thu Oct 13 11:09:36 2016 +1100
Committer: Samuel Chong 
Committed: Thu Oct 13 11:09:36 2016 +1100

--
 CHANGES.rst |  19 +++
 docs/other/hacktoberfest.txt|   1 +
 libcloud/__init__.py|   2 +-
 libcloud/compute/drivers/dimensiondata.py   |   2 +-
 libcloud/compute/drivers/ovh.py | 148 +++
 libcloud/container/drivers/rancher.py   |  26 +++-
 .../fixtures/ovh/volume_snapshot_get.json   |  22 +++
 .../ovh/volume_snapshot_get_details.json|  10 ++
 libcloud/test/compute/test_ovh.py   |  38 +
 libcloud/test/container/test_rancher.py |  14 +-
 10 files changed, 252 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/81829b47/libcloud/compute/drivers/dimensiondata.py
--



[1/5] libcloud git commit: update create_node function for MCP2 and implement backward compatibility for MCP1 using kwarg

2016-10-24 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk c2edb008e -> e62eb2bcc


update create_node function for  MCP2 and implement backward compatibility for 
MCP1 using kwarg


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

Branch: refs/heads/trunk
Commit: 95d1001592013af05198e76ce5f6cc1a3960515e
Parents: 4d11ec2
Author: Samuel Chong 
Authored: Tue Oct 11 11:47:55 2016 +1100
Committer: Samuel Chong 
Committed: Tue Oct 11 11:47:55 2016 +1100

--
 libcloud/common/dimensiondata.py|   3 +-
 libcloud/compute/drivers/dimensiondata.py   | 579 ++-
 libcloud/test/compute/test_dimensiondata.py | 324 -
 3 files changed, 782 insertions(+), 124 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/95d10015/libcloud/common/dimensiondata.py
--
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 84bca0d..e0ab33e 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -732,7 +732,8 @@ class DimensionDataServerDisk(object):
 """
 A class that represents the disk on a server
 """
-def __init__(self, id, scsi_id, size_gb, speed, state):
+def __init__(self, id=None, scsi_id=None, size_gb=None, speed=None,
+ state=None):
 """
 Instantiate a new :class:`DimensionDataServerDisk`
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/95d10015/libcloud/compute/drivers/dimensiondata.py
--
diff --git a/libcloud/compute/drivers/dimensiondata.py 
b/libcloud/compute/drivers/dimensiondata.py
index 8900086..8d19022 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -44,6 +44,7 @@ from libcloud.common.dimensiondata import 
DimensionDataIpAddress
 from libcloud.common.dimensiondata import DimensionDataPortList
 from libcloud.common.dimensiondata import DimensionDataPort
 from libcloud.common.dimensiondata import DimensionDataChildPortList
+from libcloud.common.dimensiondata import DimensionDataNic
 from libcloud.common.dimensiondata import NetworkDomainServicePlan
 from libcloud.common.dimensiondata import DimensionDataTagKey
 from libcloud.common.dimensiondata import DimensionDataTag
@@ -129,84 +130,61 @@ class DimensionDataNodeDriver(NodeDriver):
 kwargs['region'] = self.selected_region
 return kwargs
 
-def create_node(self, name, image, auth, ex_description,
-ex_network=None, ex_network_domain=None,
-ex_vlan=None, ex_primary_ipv4=None,
-ex_memory_gb=None,
-ex_cpu_specification=None,
-ex_is_started=True, ex_additional_nics_vlan=None,
-ex_additional_nics_ipv4=None,
-ex_primary_dns=None,
-ex_secondary_dns=None, **kwargs):
+def _create_node_mcp1(self, name, image, auth, ex_description,
+  ex_network=None,
+  ex_memory_gb=None,
+  ex_cpu_specification=None,
+  ex_is_started=True,
+  ex_primary_dns=None,
+  ex_secondary_dns=None, **kwargs):
 """
-Create a new DimensionData node
-
-:keywordname:   String with a name for this new node (required)
-:type   name:   ``str``
-
-:keywordimage:  OS Image to boot on node. (required)
-:type   image:  :class:`NodeImage` or ``str``
-
-:keywordauth:   Initial authentication information for the
-node. (If this is a customer LINUX
-image auth will be ignored)
-:type   auth:   :class:`NodeAuthPassword` or ``str`` or ``None``
-
-:keywordex_description:  description for this node (required)
-:type   ex_description:  ``str``
-
-:keywordex_network:  Network to create the node within
- (required unless using ex_network_domain
- or ex_primary_ipv4)
+Create a new DimensionData node
 
-:type   ex_network: :class:`DimensionDataNetwork` or ``str``
+:keywordname:   String with a name for this new node (required)
+:type   name:   ``str``
 
-:keywordex_network_domain:  Network Domain to create the node
- 

[GitHub] libcloud pull request #921: google: Prevent GCE auth to hide S3 auth

2016-10-24 Thread pquentin
GitHub user pquentin opened a pull request:

https://github.com/apache/libcloud/pull/921

google: Prevent GCE auth to hide S3 auth

## Prevent GCE auth to hide S3 auth

### Description

We currently authenticate to Google Cloud Storage using Amazon S3 
compatibility auth. Our code runs in Kubernetes on Google Container Engine. We 
tried to upgrade libcloud recently but 3849f65 from @crunk1 prevented us to 
authenticate. (Interestingly, it's also the commit that made us want to 
upgrade, since we eventually want to use service accounts.)

The issue happened for two reasons:

 * `GoogleAuthType._is_gce()` always returns True when the code is run on 
the Google Container Engine, regardless of the authentication provided (which 
makes the issue impossible to reproduce in a local Docker environment)
 * `GoogleAuthType._is_gcs_s3()` is always checked *after* `_is_gce()`, so 
it could not be used on Google Container Engine

This pull request simply changes the order to give S3 higher priority. Note 
that Installed Applications auth has lower priority still, because it's the 
default auth when everything else fails. That's OK because I guess it's not 
possible on GCE. Still, I think the documentation should recommend to always 
specify the auth type, because explicit is better than implicit and it helps to 
avoid unclear errors.

### done, ready for review

### Checklist (tick everything that applies)

- [x] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/pquentin/libcloud trunk

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/921.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #921


commit b7694bf145f6cd8d8827070866ffc4b0ad2d6705
Author: Quentin Pradet 
Date:   2016-10-21T12:46:11Z

google: Prevent GCE auth to hide S3 auth

GoogleAuthType._is_gce() is going to return True on any GCE instance,
but if there are S3 credentials, they should be used.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---