[GitHub] libcloud pull request #1118: Improve CA_CERTS_PATH defined as list warning

2017-10-06 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[2/4] libcloud git commit: Cleanup test_http.py

2017-10-06 Thread quentinp
Cleanup test_http.py


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

Branch: refs/heads/trunk
Commit: 6333ca7be6591ea2855a51fed5aa91a2bcbd7e9c
Parents: fa074d1
Author: Quentin Pradet 
Authored: Tue Oct 3 09:23:38 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:28:20 2017 +0400

--
 libcloud/test/test_http.py | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/6333ca7b/libcloud/test/test_http.py
--
diff --git a/libcloud/test/test_http.py b/libcloud/test/test_http.py
index 4da6454..dbe742c 100644
--- a/libcloud/test/test_http.py
+++ b/libcloud/test/test_http.py
@@ -25,14 +25,14 @@ from libcloud.http import LibcloudConnection
 
 from libcloud.test import unittest
 
-ORIGINAL_CA_CERS_PATH = libcloud.security.CA_CERTS_PATH
+ORIGINAL_CA_CERTS_PATH = libcloud.security.CA_CERTS_PATH
 
 
 class TestHttpLibSSLTests(unittest.TestCase):
 
 def setUp(self):
 libcloud.security.VERIFY_SSL_CERT = False
-libcloud.security.CA_CERTS_PATH = ORIGINAL_CA_CERS_PATH
+libcloud.security.CA_CERTS_PATH = ORIGINAL_CA_CERTS_PATH
 self.httplib_object = LibcloudConnection('foo.bar', port=80)
 
 def test_custom_ca_path_using_env_var_doesnt_exist(self):
@@ -66,8 +66,7 @@ class TestHttpLibSSLTests(unittest.TestCase):
 
 self.assertEqual(libcloud.security.CA_CERTS_PATH, file_path)
 
-@patch('warnings.warn')
-def test_setup_ca_cert(self, _):
+def test_setup_ca_cert(self):
 # verify = False, _setup_ca_cert should be a no-op
 self.httplib_object.verify = False
 self.httplib_object._setup_ca_cert()



[4/4] libcloud git commit: Add changes for #1118

2017-10-06 Thread quentinp
Add changes for #1118

Closes #1118


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

Branch: refs/heads/trunk
Commit: 2075b87f66cabe76083c601ee087088048cd9c41
Parents: c2e71ec
Author: Quentin Pradet 
Authored: Fri Oct 6 23:31:00 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:31:00 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/2075b87f/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index d0dd67f..3d91b40 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,12 @@
 Changes in Apach Libcloud in development
 
 
+Common
+~~
+
+- Improve warning when CA_CERTS_PATH is incorrectly passed as a list 
(GITHUB-1118)
+  [Quentin Pradet]
+
 Compute
 ~~~
 



[1/4] libcloud git commit: Test 'CA_CERTS_PATH defined as list' warning

2017-10-06 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk 8eab5d210 -> 2075b87f6


Test 'CA_CERTS_PATH defined as list' warning


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

Branch: refs/heads/trunk
Commit: c2e71ecb4c2b97d858eebac8cae384438338f268
Parents: 6333ca7
Author: Quentin Pradet 
Authored: Tue Oct 3 09:24:00 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:28:20 2017 +0400

--
 libcloud/http.py   | 26 ++
 libcloud/test/test_http.py | 11 ++-
 2 files changed, 24 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c2e71ecb/libcloud/http.py
--
diff --git a/libcloud/http.py b/libcloud/http.py
index b855b42..9149995 100644
--- a/libcloud/http.py
+++ b/libcloud/http.py
@@ -144,22 +144,24 @@ class LibcloudBaseConnection(object):
 def _setup_verify(self):
 self.verify = libcloud.security.VERIFY_SSL_CERT
 
-def _setup_ca_cert(self):
+def _setup_ca_cert(self, **kwargs):
+# simulating keyword-only argument in Python 2
+ca_certs_path = kwargs.get('ca_cert', libcloud.security.CA_CERTS_PATH)
+
 if self.verify is False:
 pass
 else:
-if isinstance(libcloud.security.CA_CERTS_PATH, list):
-if len(libcloud.security.CA_CERTS_PATH) > 1:
-msg = ('Providing a list of CA trusts is no longer '
-   'supported since libcloud 2.0. Using the first '
-   'element in the list. See '
-   'http://libcloud.readthedocs.io/en/latest/other/'
-   'changes_in_2_0.html#providing-a-list-of-ca-trusts-'
-   'is-no-longer-supported')
-warnings.warn(msg)
-self.ca_cert = libcloud.security.CA_CERTS_PATH[0]
+if isinstance(ca_certs_path, list):
+msg = (
+'Providing a list of CA trusts is no longer supported '
+'since libcloud 2.0. Using the first element in the list. '
+'See http://libcloud.readthedocs.io/en/latest/other/'
+'changes_in_2_0.html#providing-a-list-of-ca-trusts-is-no-'
+'longer-supported')
+warnings.warn(msg, DeprecationWarning)
+self.ca_cert = ca_certs_path[0]
 else:
-self.ca_cert = libcloud.security.CA_CERTS_PATH
+self.ca_cert = ca_certs_path
 
 def _setup_signing(self, cert_file=None, key_file=None):
 """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c2e71ecb/libcloud/test/test_http.py
--
diff --git a/libcloud/test/test_http.py b/libcloud/test/test_http.py
index dbe742c..2e9eeb1 100644
--- a/libcloud/test/test_http.py
+++ b/libcloud/test/test_http.py
@@ -16,7 +16,7 @@
 import os
 import sys
 import os.path
-from mock import patch
+import warnings
 
 import libcloud.security
 
@@ -66,6 +66,15 @@ class TestHttpLibSSLTests(unittest.TestCase):
 
 self.assertEqual(libcloud.security.CA_CERTS_PATH, file_path)
 
+def test_ca_cert_list_warning(self):
+with warnings.catch_warnings(record=True) as w:
+self.httplib_object.verify = True
+self.httplib_object._setup_ca_cert(
+ca_cert=[ORIGINAL_CA_CERTS_PATH])
+self.assertEqual(self.httplib_object.ca_cert,
+ ORIGINAL_CA_CERTS_PATH)
+self.assertEqual(w[0].category, DeprecationWarning)
+
 def test_setup_ca_cert(self):
 # verify = False, _setup_ca_cert should be a no-op
 self.httplib_object.verify = False



[3/4] libcloud git commit: Improve CA_CERTS_PATH defined as list warning

2017-10-06 Thread quentinp
Improve CA_CERTS_PATH defined as list warning


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

Branch: refs/heads/trunk
Commit: fa074d1737d9c60bf1bce5a239217336583dd385
Parents: 8eab5d2
Author: Quentin Pradet 
Authored: Mon Oct 2 08:36:22 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:28:20 2017 +0400

--
 libcloud/http.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fa074d17/libcloud/http.py
--
diff --git a/libcloud/http.py b/libcloud/http.py
index 567a2a2..b855b42 100644
--- a/libcloud/http.py
+++ b/libcloud/http.py
@@ -150,7 +150,13 @@ class LibcloudBaseConnection(object):
 else:
 if isinstance(libcloud.security.CA_CERTS_PATH, list):
 if len(libcloud.security.CA_CERTS_PATH) > 1:
-warnings.warn('Only 1 certificate path is supported')
+msg = ('Providing a list of CA trusts is no longer '
+   'supported since libcloud 2.0. Using the first '
+   'element in the list. See '
+   'http://libcloud.readthedocs.io/en/latest/other/'
+   'changes_in_2_0.html#providing-a-list-of-ca-trusts-'
+   'is-no-longer-supported')
+warnings.warn(msg)
 self.ca_cert = libcloud.security.CA_CERTS_PATH[0]
 else:
 self.ca_cert = libcloud.security.CA_CERTS_PATH



libcloud git commit: azure_arm: Remove bogus handling of 'updating' state

2017-10-06 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk 311a9546b -> 8eab5d210


azure_arm: Remove bogus handling of 'updating' state


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

Branch: refs/heads/trunk
Commit: 8eab5d210cfca7115bd0f38ad270c53f4b90d0c3
Parents: 311a954
Author: Quentin Pradet 
Authored: Fri Oct 6 23:15:07 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:16:19 2017 +0400

--
 CHANGES.rst   | 2 +-
 libcloud/compute/drivers/azure_arm.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8eab5d21/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 5ea6bd2..d0dd67f 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -34,7 +34,7 @@ Compute
 - [GCE] Allow setting service account in instance templates (LIBCLOUD-947, 
GITHUB-1108)
   [Evan Carter]
 
-- [ARM] Fix API call on powerOff, convert more node states (GITHUB-1003)
+- [ARM] Fix API call on powerOff, understand PAUSED state (GITHUB-1003)
   [Markos Gogoulos]
 
 Changes in Apache Libcloud 2.2.1

http://git-wip-us.apache.org/repos/asf/libcloud/blob/8eab5d21/libcloud/compute/drivers/azure_arm.py
--
diff --git a/libcloud/compute/drivers/azure_arm.py 
b/libcloud/compute/drivers/azure_arm.py
index bb6383c..a2237bd 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1947,8 +1947,7 @@ class AzureNodeDriver(NodeDriver):
 r = self.connection.request(action,
 params={"api-version": "2015-06-15"})
 for status in r.object["statuses"]:
-if status["code"] in ["ProvisioningState/creating",
-  "ProvisioningState/updating"]:
+if status["code"] in ["ProvisioningState/creating"]:
 state = NodeState.PENDING
 break
 elif status["code"] == "ProvisioningState/deleting":



[GitHub] libcloud pull request #1003: Azure ARM optimizations (get all results on lis...

2017-10-06 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[3/3] libcloud git commit: Add changes for #1003

2017-10-06 Thread quentinp
Add changes for #1003


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

Branch: refs/heads/trunk
Commit: 311a9546b4f8bbbd89609e7f7638ff45cc05ef67
Parents: 446300d
Author: Quentin Pradet 
Authored: Fri Oct 6 23:11:21 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:11:21 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/311a9546/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index cd2f18b..5ea6bd2 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -34,6 +34,9 @@ Compute
 - [GCE] Allow setting service account in instance templates (LIBCLOUD-947, 
GITHUB-1108)
   [Evan Carter]
 
+- [ARM] Fix API call on powerOff, convert more node states (GITHUB-1003)
+  [Markos Gogoulos]
+
 Changes in Apache Libcloud 2.2.1
 
 



[2/3] libcloud git commit: azure_arm: Convert more node states

2017-10-06 Thread quentinp
azure_arm: Convert more node states

Closes #1003

Signed-off-by: Quentin Pradet 


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

Branch: refs/heads/trunk
Commit: 446300d88de9087fe8e3e6544d22140aa23ecc28
Parents: 3f29c35
Author: Markos Gogoulos 
Authored: Fri Oct 6 23:09:17 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:09:17 2017 +0400

--
 libcloud/compute/drivers/azure_arm.py | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/446300d8/libcloud/compute/drivers/azure_arm.py
--
diff --git a/libcloud/compute/drivers/azure_arm.py 
b/libcloud/compute/drivers/azure_arm.py
index 225a9b5..bb6383c 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1947,7 +1947,8 @@ class AzureNodeDriver(NodeDriver):
 r = self.connection.request(action,
 params={"api-version": "2015-06-15"})
 for status in r.object["statuses"]:
-if status["code"] == "ProvisioningState/creating":
+if status["code"] in ["ProvisioningState/creating",
+  "ProvisioningState/updating"]:
 state = NodeState.PENDING
 break
 elif status["code"] == "ProvisioningState/deleting":
@@ -1965,6 +1966,9 @@ class AzureNodeDriver(NodeDriver):
 if status["code"] == "PowerState/deallocated":
 state = NodeState.STOPPED
 break
+elif status["code"] == "PowerState/stopped":
+state = NodeState.PAUSED
+break
 elif status["code"] == "PowerState/deallocating":
 state = NodeState.PENDING
 break



[1/3] libcloud git commit: azure_arm: Fix stop_node without deallocation

2017-10-06 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk bba685f23 -> 311a9546b


azure_arm: Fix stop_node without deallocation

Closes #1003

Signed-off-by: Quentin Pradet 


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

Branch: refs/heads/trunk
Commit: 3f29c35434100112e71147779ef05716b4de7d64
Parents: bba685f
Author: Markos Gogoulos 
Authored: Fri Oct 6 23:03:03 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 23:03:56 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/3f29c354/libcloud/compute/drivers/azure_arm.py
--
diff --git a/libcloud/compute/drivers/azure_arm.py 
b/libcloud/compute/drivers/azure_arm.py
index 38ca2ae..225a9b5 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1783,7 +1783,7 @@ class AzureNodeDriver(NodeDriver):
 if deallocate:
 target = "%s/deallocate" % node.id
 else:
-target = "%s/stop" % node.id
+target = "%s/powerOff" % node.id
 r = self.connection.request(target,
 params={"api-version": "2015-06-15"},
 method='POST')



[jira] [Closed] (LIBCLOUD-952) UpCloud driver does not set the storage size and storage tier

2017-10-06 Thread Mika Lackman (JIRA)

 [ 
https://issues.apache.org/jira/browse/LIBCLOUD-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mika Lackman closed LIBCLOUD-952.
-
Resolution: Fixed

PR approved and merged

> UpCloud driver does not set the storage size and storage tier
> -
>
> Key: LIBCLOUD-952
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-952
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Reporter: Mika Lackman
>
> UpCloud's driver does not set the disk size nor the storage tier when node is 
> created from UpCloud's template



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (LIBCLOUD-952) UpCloud driver does not set the storage size and storage tier

2017-10-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-952:
-

Github user asfgit closed the pull request at:

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


> UpCloud driver does not set the storage size and storage tier
> -
>
> Key: LIBCLOUD-952
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-952
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Reporter: Mika Lackman
>
> UpCloud's driver does not set the disk size nor the storage tier when node is 
> created from UpCloud's template



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[2/2] libcloud git commit: Add changes for #1124

2017-10-06 Thread quentinp
Add changes for #1124


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

Branch: refs/heads/trunk
Commit: bba685f23b535c33e344801c095eaee80cc6ca99
Parents: 63eeacd
Author: Quentin Pradet 
Authored: Fri Oct 6 22:46:19 2017 +0400
Committer: Quentin Pradet 
Committed: Fri Oct 6 22:46:19 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/bba685f2/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index a61b90b..cd2f18b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,7 +7,7 @@ Changes in Apach Libcloud in development
 Compute
 ~~~
 
-- New driver for UpCloud (LIBCLOUD-938, LIBCLOUD-951, GITHUB-1102, GITHUB-1123)
+- New driver for UpCloud (LIBCLOUD-938, LIBCLOUD-951, LIBCLOUD-952, 
GITHUB-1102, GITHUB-1123, GITHUB-1124)
   [Mika Lackman, Ilari Mäkelä]
 
 - [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)



[GitHub] libcloud pull request #1124: [LIBCLOUD-952] Use disk size and storage tier a...

2017-10-06 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[1/2] libcloud git commit: Use disk size and storage tier also when creating node from template

2017-10-06 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk 4fef3b539 -> bba685f23


Use disk size and storage tier also when creating node from template

Closes #1124

Signed-off-by: Quentin Pradet 


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

Branch: refs/heads/trunk
Commit: 63eeacd4f7c463bbeb0427d72fb852f3d3404232
Parents: 4fef3b5
Author: Mika Lackman 
Authored: Fri Oct 6 17:58:47 2017 +0300
Committer: Quentin Pradet 
Committed: Fri Oct 6 22:45:33 2017 +0400

--
 libcloud/common/upcloud.py| 29 +
 libcloud/test/common/test_upcloud.py  | 35 --
 libcloud/test/compute/test_upcloud.py |  4 ++--
 3 files changed, 50 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/63eeacd4/libcloud/common/upcloud.py
--
diff --git a/libcloud/common/upcloud.py b/libcloud/common/upcloud.py
index 64f844e..796fa58 100644
--- a/libcloud/common/upcloud.py
+++ b/libcloud/common/upcloud.py
@@ -230,25 +230,19 @@ class _StorageDevice(object):
 return self._storage_device_for_cdrom_image()
 
 def _storage_device_for_template_image(self):
-storage_devices = {
-'storage_device': [{
-'action': 'clone',
-'title': self.image.name,
-'storage': self.image.id
-}]
+hdd_device = {
+'action': 'clone',
+'storage': self.image.id
 }
-return storage_devices
+hdd_device.update(self._common_hdd_device())
+return {'storage_device': [hdd_device]}
 
 def _storage_device_for_cdrom_image(self):
+hdd_device = {'action': 'create'}
+hdd_device.update(self._common_hdd_device())
 storage_devices = {
 'storage_device': [
-{
-'action': 'create',
-'title': self.image.name,
-'size': self.size.disk,
-'tier': self.size.extra['storage_tier']
-
-},
+hdd_device,
 {
 'action': 'attach',
 'storage': self.image.id,
@@ -257,3 +251,10 @@ class _StorageDevice(object):
 ]
 }
 return storage_devices
+
+def _common_hdd_device(self):
+return {
+'title': self.image.name,
+'size': self.size.disk,
+'tier': self.size.extra.get('storage_tier', 'maxiops')
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/63eeacd4/libcloud/test/common/test_upcloud.py
--
diff --git a/libcloud/test/common/test_upcloud.py 
b/libcloud/test/common/test_upcloud.py
index bfa2b89..6d6ee0f 100644
--- a/libcloud/test/common/test_upcloud.py
+++ b/libcloud/test/common/test_upcloud.py
@@ -18,6 +18,7 @@ import json
 from mock import Mock, call
 
 from libcloud.common.upcloud import UpcloudCreateNodeRequestBody, 
UpcloudNodeDestroyer, UpcloudNodeOperations
+from libcloud.common.upcloud import _StorageDevice
 from libcloud.common.upcloud import UpcloudTimeoutException
 from libcloud.compute.base import NodeImage, NodeSize, NodeLocation, 
NodeAuthSSHKey
 from libcloud.test import unittest
@@ -49,7 +50,9 @@ class TestUpcloudCreateNodeRequestBody(unittest.TestCase):
 'storage_device': [{
 'action': 'clone',
 'title': 'Ubuntu Server 16.04 LTS (Xenial Xerus)',
-'storage': '0100--4000-8000-30060200'
+'storage': '0100--4000-8000-30060200',
+'size': 30,
+'tier': 'maxiops',
 }]
 },
 }
@@ -125,7 +128,9 @@ class TestUpcloudCreateNodeRequestBody(unittest.TestCase):
 'storage_devices': {
 'storage_device': [{
 'action': 'clone',
+'size': 30,
 'title': 'Ubuntu Server 16.04 LTS (Xenial Xerus)',
+'tier': 'maxiops',
 'storage': '0100--4000-8000-30060200'
 }]
 },
@@ -158,7 +163,9 @@ class TestUpcloudCreateNodeRequestBody(unittest.TestCase):
 'storage_device': [{
 'action': 'clone',
 'title': 'Ubuntu Server 16.04 LTS 

[jira] [Commented] (LIBCLOUD-952) UpCloud driver does not set the storage size and storage tier

2017-10-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-952:
-

GitHub user mlackman opened a pull request:

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

[LIBCLOUD-952] Use disk size and storage tier also when creating node from 
template

## Add disk size and storage tier

### Description

Added missing storage_tier and disk size to the request body for creating 
node. Storage_tier has meaningful default value when not provided.  

### Status

- 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] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [x] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


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

$ git pull https://github.com/UpCloudLtd/libcloud 
LIBCLOUD-952_UpCloud_driver_does_not_set_the_storage_size_and_storage_tier

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

https://github.com/apache/libcloud/pull/1124.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 #1124


commit e7e0869e7fbc174605f8d99172dd218685163d2a
Author: Mika Lackman 
Date:   2017-10-06T14:58:47Z

Use disk size and storage tier also when creating node from template




> UpCloud driver does not set the storage size and storage tier
> -
>
> Key: LIBCLOUD-952
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-952
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Reporter: Mika Lackman
>
> UpCloud's driver does not set the disk size nor the storage tier when node is 
> created from UpCloud's template



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] libcloud pull request #1124: [LIBCLOUD-952] Use disk size and storage tier a...

2017-10-06 Thread mlackman
GitHub user mlackman opened a pull request:

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

[LIBCLOUD-952] Use disk size and storage tier also when creating node from 
template

## Add disk size and storage tier

### Description

Added missing storage_tier and disk size to the request body for creating 
node. Storage_tier has meaningful default value when not provided.  

### Status

- 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] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [x] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


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

$ git pull https://github.com/UpCloudLtd/libcloud 
LIBCLOUD-952_UpCloud_driver_does_not_set_the_storage_size_and_storage_tier

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

https://github.com/apache/libcloud/pull/1124.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 #1124


commit e7e0869e7fbc174605f8d99172dd218685163d2a
Author: Mika Lackman 
Date:   2017-10-06T14:58:47Z

Use disk size and storage tier also when creating node from template




---


[jira] [Closed] (LIBCLOUD-951) Add possibility to define hostname to UpCloud driver

2017-10-06 Thread Mika Lackman (JIRA)

 [ 
https://issues.apache.org/jira/browse/LIBCLOUD-951?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mika Lackman closed LIBCLOUD-951.
-
Resolution: Fixed

PR is approved and merged

> Add possibility to define hostname to UpCloud driver
> 
>
> Key: LIBCLOUD-951
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-951
> Project: Libcloud
>  Issue Type: Improvement
>  Components: Compute
>Reporter: Mika Lackman
>
> Add way to define hostname



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (LIBCLOUD-938) Upcloud compute driver

2017-10-06 Thread Mika Lackman (JIRA)

 [ 
https://issues.apache.org/jira/browse/LIBCLOUD-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mika Lackman closed LIBCLOUD-938.
-
Resolution: Fixed

PR is approved and merged

> Upcloud compute driver
> --
>
> Key: LIBCLOUD-938
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-938
> Project: Libcloud
>  Issue Type: New Feature
>  Components: Compute
>Reporter: Mika Lackman
>Priority: Minor
>
> Upcloud compute driver. Will be done against Upcloud's 1.2.4 api version 
> Upcloud's api documentation can be found from:
> https://www.upcloud.com/api/1.2.4/



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (LIBCLOUD-952) UpCloud driver does not set the storage size and storage tier

2017-10-06 Thread Mika Lackman (JIRA)
Mika Lackman created LIBCLOUD-952:
-

 Summary: UpCloud driver does not set the storage size and storage 
tier
 Key: LIBCLOUD-952
 URL: https://issues.apache.org/jira/browse/LIBCLOUD-952
 Project: Libcloud
  Issue Type: Bug
  Components: Compute
Reporter: Mika Lackman


UpCloud's driver does not set the disk size nor the storage tier when node is 
created from UpCloud's template



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)