[jira] [Commented] (LIBCLOUD-926) [BUG Azure_ARM] in ex_create_public_ip function among other

2017-09-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-926:
-

Github user asfgit closed the pull request at:

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


> [BUG Azure_ARM] in ex_create_public_ip function among other
> ---
>
> Key: LIBCLOUD-926
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-926
> Project: Libcloud
>  Issue Type: Bug
>  Components: Compute
>Reporter: Cristina Guerra
>  Labels: azurecompute-arm, compute
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In the file libcloud/compute/drivers/azure_arm.py.
> There are some functions as ex_create_public_ip function that it needs a 
> location parameter, when this parameter is send, a error happen:  "Location 
> is required".
> Looking at the code I found with the following:
> {code:python}
>if location is None and self.default_location:
> location = self.default_location
> else:
> raise ValueError("location is required.")
> {code}
> This does not evaluate a possible parameter, only if the value is None.
> I propose:
> {code:python}
> if location is None and self.default_location:
> location = self.default_location
> elif location is not None:
> location = location
> else:
> raise ValueError("location is required.")
> {code}



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


[GitHub] libcloud pull request #1098: LIBCLOUD-926 - Propagated changes to azure_arm....

2017-09-26 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[2/2] libcloud git commit: Fix error when using SSH key auth with Python 3

2017-09-26 Thread quentinp
Fix error when using SSH key auth with Python 3

When using SSH key authentication, the randomly generated HEX password for 
admin account is encoded as bytes which results in a JSON serialization error. 
Changed the encoding to UTF-8.

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/4e42f86b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4e42f86b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4e42f86b

Branch: refs/heads/trunk
Commit: 4e42f86bb9b3824e92874e0aedea83d7b649d1ed
Parents: fe0a848
Author: SElsharkawy 
Authored: Tue May 2 13:50:48 2017 -0400
Committer: Quentin Pradet 
Committed: Wed Sep 27 08:25:25 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e42f86b/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index fe13a41..7ba1806 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -28,6 +28,9 @@ Compute
 - [ARM] Fix checking for "location is None" in several functions 
(LIBCLOUD-926, GITHUB-1098)
   [Sameh Elsharkawy]
 
+- [ARM] Fix error when using SSH key auth with Python 3 (GITHUB-1098)
+  [Sameh Elsharkawy]
+
 Changes in Apache Libcloud 2.2.1
 
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e42f86b/libcloud/compute/drivers/azure_arm.py
--
diff --git a/libcloud/compute/drivers/azure_arm.py 
b/libcloud/compute/drivers/azure_arm.py
index 45db5a1..38ca2ae 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -623,7 +623,7 @@ class AzureNodeDriver(NodeDriver):
 
 if isinstance(auth, NodeAuthSSHKey):
 data["properties"]["osProfile"]["adminPassword"] = \
-binascii.hexlify(os.urandom(20))
+binascii.hexlify(os.urandom(20)).decode("utf-8")
 data["properties"]["osProfile"]["linuxConfiguration"] = {
 "disablePasswordAuthentication": "true",
 "ssh": {



[1/2] libcloud git commit: Fix checking for "location is None" in several functions

2017-09-26 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk 4d5934230 -> 4e42f86bb


Fix checking for "location is None" in several functions

Closes #1098

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/fe0a8484
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fe0a8484
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fe0a8484

Branch: refs/heads/trunk
Commit: fe0a8484c5bab6bafa156663f81a6cda53f1e492
Parents: 4d59342
Author: Elsharkawy, Sameh 
Authored: Wed Sep 27 08:17:16 2017 +0400
Committer: Quentin Pradet 
Committed: Wed Sep 27 08:21:25 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fe0a8484/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index ab64c0e..fe13a41 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -25,6 +25,9 @@ Compute
 - [GCE] Fix `GCEList` pagination. (GITHUB-1095)
   [Yap Sok Ann]
 
+- [ARM] Fix checking for "location is None" in several functions 
(LIBCLOUD-926, GITHUB-1098)
+  [Sameh Elsharkawy]
+
 Changes in Apache Libcloud 2.2.1
 
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fe0a8484/libcloud/compute/drivers/azure_arm.py
--
diff --git a/libcloud/compute/drivers/azure_arm.py 
b/libcloud/compute/drivers/azure_arm.py
index 8950c2a..45db5a1 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1407,10 +1407,11 @@ class AzureNodeDriver(NodeDriver):
 :type location: :class:`.NodeLocation`
 """
 
-if location is None and self.default_location:
-location = self.default_location
-else:
-raise ValueError("location is required.")
+if location is None:
+if self.default_location:
+location = self.default_location
+else:
+raise ValueError("location is required.")
 
 target = "/subscriptions/%s/resourceGroups/%s/" \
  "providers/Microsoft.Network/networkSecurityGroups/%s" \
@@ -1440,10 +1441,11 @@ class AzureNodeDriver(NodeDriver):
 :type location: :class:`.NodeLocation`
 """
 
-if location is None and self.default_location:
-location = self.default_location
-else:
-raise ValueError("location is required.")
+if location is None:
+if self.default_location:
+location = self.default_location
+else:
+raise ValueError("location is required.")
 
 target = "/subscriptions/%s/resourceGroups/%s/" \
  "providers/Microsoft.Network/networkSecurityGroups/%s" \
@@ -1628,10 +1630,11 @@ class AzureNodeDriver(NodeDriver):
 :rtype: :class:`.AzureIPAddress`
 """
 
-if location is None and self.default_location:
-location = self.default_location
-else:
-raise ValueError("location is required.")
+if location is None:
+if self.default_location:
+location = self.default_location
+else:
+raise ValueError("location is required.")
 
 target = "/subscriptions/%s/resourceGroups/%s/" \
  "providers/Microsoft.Network/publicIPAddresses/%s" \



libcloud git commit: Fix recent changes formatting and linked issues

2017-09-26 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk d8be2d472 -> 4d5934230


Fix recent changes formatting and linked issues


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

Branch: refs/heads/trunk
Commit: 4d59342302c8ffd8e09e9e03f7f73e5bf618bfb0
Parents: d8be2d4
Author: Quentin Pradet 
Authored: Wed Sep 27 08:13:21 2017 +0400
Committer: Quentin Pradet 
Committed: Wed Sep 27 08:13:21 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4d593423/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index ea472eb..ab64c0e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,7 +7,7 @@ Changes in Apach Libcloud in development
 Compute
 ~~~
 
-- New driver for UpCloud (GITHUB-1102)
+- New driver for UpCloud (LIBCLOUD-938, GITHUB-1102)
   [Mika Lackman, Ilari Mäkelä]
 
 - [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)
@@ -19,7 +19,8 @@ Compute
 - Update ProfitBricks driver and add support for the new API v4. (GITHUB-1103)
   [Nurfet Becirevic]
 
-- [GCE] Support GCE node labels. (GITHUB-1115) [@maxlip]
+- [GCE] Support GCE node labels. (LIBCLOUD-934, GITHUB-1115)
+  [@maxlip]
 
 - [GCE] Fix `GCEList` pagination. (GITHUB-1095)
   [Yap Sok Ann]



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

2017-09-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-938:
-

Github user asfgit closed the pull request at:

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


> 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)


[GitHub] libcloud pull request #1102: [LIBCLOUD-938] New compute driver for UpCloud

2017-09-26 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[08/14] libcloud git commit: inherit exception from LibcloudError

2017-09-26 Thread quentinp
inherit exception from LibcloudError

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/5326c9aa
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5326c9aa
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5326c9aa

Branch: refs/heads/trunk
Commit: 5326c9aa938c35fd773d27d2d53c9e5e21d3658f
Parents: 82b5c3c
Author: Mika Lackman 
Authored: Sun Sep 24 19:38:38 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5326c9aa/libcloud/common/upcloud.py
--
diff --git a/libcloud/common/upcloud.py b/libcloud/common/upcloud.py
index a63be08..02413fc 100644
--- a/libcloud/common/upcloud.py
+++ b/libcloud/common/upcloud.py
@@ -16,9 +16,10 @@ import json
 import time
 
 from libcloud.common.exceptions import BaseHTTPError
+from libcloud.common.types import LibcloudError
 
 
-class UpcloudTimeoutException(Exception):
+class UpcloudTimeoutException(LibcloudError):
 pass
 
 



[04/14] libcloud git commit: New compute driver for UpCloud

2017-09-26 Thread quentinp
New compute driver for UpCloud

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/abbd9bb6
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/abbd9bb6
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/abbd9bb6

Branch: refs/heads/trunk
Commit: abbd9bb63f8b1295bc67fbcf8f271f89ed79e4d6
Parents: 5892fa1
Author: Mika Lackman 
Authored: Mon Aug 14 14:03:29 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 libcloud/common/upcloud.py  | 183 +
 libcloud/compute/drivers/upcloud.py | 277 +
 libcloud/compute/types.py   |   2 +
 libcloud/test/common/test_upcloud.py| 212 ++
 .../compute/fixtures/upcloud/api_1_2_plan.json  |  38 ++
 .../fixtures/upcloud/api_1_2_server.json|  22 +
 ...er_00893c98-5d5a-4363-b177-88df518a2b60.json |  58 +++
 ...er_00f8c525-7e62-4108-8115-3958df5b43dc.json |  57 +++
 ...525-7e62-4108-8115-3958df5b43dc_restart.json |  57 +++
 .../upcloud/api_1_2_server_from_cdrom.json  |  65 +++
 .../upcloud/api_1_2_server_from_template.json   |  59 +++
 .../fixtures/upcloud/api_1_2_storage_cdrom.json | 411 +++
 .../upcloud/api_1_2_storage_template.json   | 114 +
 .../compute/fixtures/upcloud/api_1_2_zone.json  |  30 ++
 .../upcloud/api_1_2_zone_failed_auth.json   |   6 +
 libcloud/test/compute/test_upcloud.py   | 248 +++
 libcloud/test/secrets.py-dist   |   1 +
 17 files changed, 1840 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/abbd9bb6/libcloud/common/upcloud.py
--
diff --git a/libcloud/common/upcloud.py b/libcloud/common/upcloud.py
new file mode 100644
index 000..432606a
--- /dev/null
+++ b/libcloud/common/upcloud.py
@@ -0,0 +1,183 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import json
+import time
+
+from libcloud.common.exceptions import BaseHTTPError
+
+
+class UpcloudTimeoutException(Exception):
+pass
+
+
+class UpcloudCreateNodeRequestBody(object):
+"""Body of the create_node request
+
+Takes the create_node arguments (**kwargs) and constructs the request body
+"""
+def __init__(self, user_id, name, size, image, location, auth=None):
+self.body = {
+'server': {
+'title': name,
+'hostname': 'localhost',
+'plan': size.id,
+'zone': location.id,
+'login_user': _LoginUser(user_id, auth).to_dict(),
+'storage_devices': _StorageDevice(image, size).to_dict()
+}
+}
+
+def to_json(self):
+"""Serializes the body to json"""
+return json.dumps(self.body)
+
+
+class UpcloudNodeDestroyer(object):
+"""Destroyes the node.
+Node must be first stopped and then it can be
+destroyed"""
+
+WAIT_AMOUNT = 2
+SLEEP_COUNT_TO_TIMEOUT = 20
+
+def __init__(self, upcloud_node_operations, sleep_func=None):
+self._operations = upcloud_node_operations
+self._sleep_func = sleep_func or time.sleep
+self._sleep_count = 0
+
+def destroy_node(self, node_id):
+self._stop_called = False
+self._sleep_count = 0
+return self._do_destroy_node(node_id)
+
+def _do_destroy_node(self, node_id):
+state = self._operations.node_state(node_id)
+if state == 'stopped':
+self._operations.destroy_node(node_id)
+return True
+elif state == 'error':
+return False
+elif state == 'started':
+if not self._stop_called:
+self._operations.stop_node(node_id)
+self._stop_called = True
+else:
+# Waiting for started state to change and
+# not calling stop again
+self._sleep()
+

[09/14] libcloud git commit: Upcloud renamed to UpCloud

2017-09-26 Thread quentinp
Upcloud renamed to UpCloud

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/0e0b6831
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/0e0b6831
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/0e0b6831

Branch: refs/heads/trunk
Commit: 0e0b68319ba8771122a1418bd8bb9ac351ba9ed3
Parents: 5326c9a
Author: Mika Lackman 
Authored: Sun Sep 24 19:38:54 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0e0b6831/libcloud/compute/types.py
--
diff --git a/libcloud/compute/types.py b/libcloud/compute/types.py
index b360c0e..0de0497 100644
--- a/libcloud/compute/types.py
+++ b/libcloud/compute/types.py
@@ -98,7 +98,7 @@ class Provider(Type):
 :cvar RACKSPACE_FIRST_GEN: Rackspace First Gen Cloud Servers
 :cvar RIMUHOSTING: RimuHosting.com
 :cvar TERREMARK: Terremark
-:cvar UPCLOUD: Upcloud
+:cvar UPCLOUD: UpCloud
 :cvar VCL: VCL driver
 :cvar VCLOUD: vmware vCloud
 :cvar VPSNET: VPS.net



[14/14] libcloud git commit: Renamed SERVER_STATE to NODE_STATE_MAP and moved it to UpcloudDriver for better consistency with other drivers

2017-09-26 Thread quentinp
Renamed SERVER_STATE to NODE_STATE_MAP and moved it to UpcloudDriver for better 
consistency with other drivers

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/e7df9487
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e7df9487
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e7df9487

Branch: refs/heads/trunk
Commit: e7df94873dc0e2f9c5bfdd358fe99da6eda82c04
Parents: a2dc54a
Author: Mika Lackman 
Authored: Tue Sep 26 15:33:23 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 libcloud/compute/drivers/upcloud.py | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e7df9487/libcloud/compute/drivers/upcloud.py
--
diff --git a/libcloud/compute/drivers/upcloud.py 
b/libcloud/compute/drivers/upcloud.py
index d2e0314..c9c762e 100644
--- a/libcloud/compute/drivers/upcloud.py
+++ b/libcloud/compute/drivers/upcloud.py
@@ -28,13 +28,6 @@ from libcloud.common.upcloud import 
UpcloudCreateNodeRequestBody
 from libcloud.common.upcloud import UpcloudNodeDestroyer
 from libcloud.common.upcloud import UpcloudNodeOperations
 
-SERVER_STATE = {
-'started': NodeState.RUNNING,
-'stopped': NodeState.STOPPED,
-'maintenance': NodeState.RECONFIGURING,
-'error': NodeState.ERROR
-}
-
 
 class UpcloudResponse(JsonResponse):
 """
@@ -92,6 +85,13 @@ class UpcloudDriver(NodeDriver):
 connectionCls = UpcloudConnection
 features = {'create_node': ['ssh_key', 'generates_password']}
 
+NODE_STATE_MAP = {
+'started': NodeState.RUNNING,
+'stopped': NodeState.STOPPED,
+'maintenance': NodeState.RECONFIGURING,
+'error': NodeState.ERROR
+}
+
 def __init__(self, username, password, **kwargs):
 super(UpcloudDriver, self).__init__(key=username, secret=password,
 **kwargs)
@@ -236,7 +236,7 @@ class UpcloudDriver(NodeDriver):
 extra['password'] = server['password']
 return Node(id=server['uuid'],
 name=server['title'],
-state=state or SERVER_STATE[server['state']],
+state=state or self.NODE_STATE_MAP[server['state']],
 public_ips=public_ips,
 private_ips=private_ips,
 driver=self,



[10/14] libcloud git commit: Added upcloud.png to provider logos

2017-09-26 Thread quentinp
Added upcloud.png to provider logos

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/d78edb8f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d78edb8f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d78edb8f

Branch: refs/heads/trunk
Commit: d78edb8fb1e6404f49576fb670b046071c5f8fa5
Parents: fdbd943
Author: Ilari Mäkelä 
Authored: Tue Sep 26 10:52:33 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 docs/_static/images/provider_logos/upcloud.png | Bin 0 -> 20107 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d78edb8f/docs/_static/images/provider_logos/upcloud.png
--
diff --git a/docs/_static/images/provider_logos/upcloud.png 
b/docs/_static/images/provider_logos/upcloud.png
new file mode 100644
index 000..5b5f205
Binary files /dev/null and b/docs/_static/images/provider_logos/upcloud.png 
differ



[01/14] libcloud git commit: Add changes for #1102

2017-09-26 Thread quentinp
Repository: libcloud
Updated Branches:
  refs/heads/trunk 5892fa1be -> d8be2d472


Add changes for #1102

Closes #1102


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

Branch: refs/heads/trunk
Commit: d8be2d472b4fbd6c88d6e4e1d00f2aeda11a77a7
Parents: f37b7c0
Author: Quentin Pradet 
Authored: Wed Sep 27 06:57:09 2017 +0400
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d8be2d47/CHANGES.rst
--
diff --git a/CHANGES.rst b/CHANGES.rst
index 527ecd4..ea472eb 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,9 @@ Changes in Apach Libcloud in development
 Compute
 ~~~
 
+- New driver for UpCloud (GITHUB-1102)
+  [Mika Lackman, Ilari Mäkelä]
+
 - [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)
   [@zulupro]
 



[05/14] libcloud git commit: New compute driver for UpCloud

2017-09-26 Thread quentinp
New compute driver for UpCloud

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/33c1e6fd
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/33c1e6fd
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/33c1e6fd

Branch: refs/heads/trunk
Commit: 33c1e6fdbbb6ceefc9be933ebfe555930a0a02d2
Parents: abbd9bb
Author: Mika Lackman 
Authored: Mon Aug 14 14:03:29 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 libcloud/test/compute/test_upcloud.py | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/33c1e6fd/libcloud/test/compute/test_upcloud.py
--
diff --git a/libcloud/test/compute/test_upcloud.py 
b/libcloud/test/compute/test_upcloud.py
index 41d02a0..98e0105 100644
--- a/libcloud/test/compute/test_upcloud.py
+++ b/libcloud/test/compute/test_upcloud.py
@@ -130,13 +130,7 @@ class UpcloudDriverTests(LibcloudTestCase):
 size = NodeSize(id='1xCPU-1GB', name='1xCPU-1GB', ram=1024, disk=30, 
bandwidth=2048,
 extra={'core_number': 1, 'storage_tier': 'maxiops'}, 
price=None, driver=self.driver)
 
-auth = NodeAuthSSHKey('ssh-rsa 
B3NzaC1yc2EDAQABAAABAQDCUUFfYA+T+BzoM7IIR' +
-  
'VXNndDjYvIROMjfyRBhhHf6RZd1IkAwcWSGISePh2tIiqu8gJalYYHg2w' +
-  
'i3ofMJfi6VYeyBFWrIDhMK0v+ziBbBUtlJNnP6MBOR/13avkk+76TVrcG' +
-  
'xu49RaptYNzZ21XluvIlaqqdjAhoh0J+o7OZTKD7N1UTPL7CIX+ITaA+g' +
-  
'3FR5ITClk8KmIbp3vT6fUPD7pNUrGBZTpcPcHq8rodQ8igWIVdSkb9iky' +
-  
'ew4y6wvsubQ3Ykn26XeKxrk1vA6ZKMHt7ijCYmfL0LcDfctNymy/vc6hs' +
-  'WxCRS5OqNQ6nxdXpv9A+TD0sJuf5jaoH7MSpU1 
mika.lack...@gmail.com')
+auth = NodeAuthSSHKey('publikey')
 node = self.driver.create_node(name='test_server', size=size, 
image=image, location=location, auth=auth)
 
self.assertTrue(re.match('^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$',
 node.id))
 self.assertEquals(node.name, 'test_server')



[11/14] libcloud git commit: Created upcloud.rst

2017-09-26 Thread quentinp
Created upcloud.rst

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/9a97e3b9
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9a97e3b9
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9a97e3b9

Branch: refs/heads/trunk
Commit: 9a97e3b9e22bef0852aaed2061328db3c9797913
Parents: 0e0b683
Author: Ilari Mäkelä 
Authored: Mon Sep 25 16:44:34 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 docs/compute/drivers/upcloud.rst | 31 +++
 1 file changed, 31 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9a97e3b9/docs/compute/drivers/upcloud.rst
--
diff --git a/docs/compute/drivers/upcloud.rst b/docs/compute/drivers/upcloud.rst
new file mode 100644
index 000..4c6a400
--- /dev/null
+++ b/docs/compute/drivers/upcloud.rst
@@ -0,0 +1,31 @@
+UpCloud Driver Documentation
+===
+`UpCloud`_ is a Finnish IaaS provider offering the most high performance 
+servers with extremely redundant infrastructure to the most demanding 
customers.
+
+.. figure:: /_static/images/provider_logos/upcloud.png
+:align: center
+:width: 300
+:target: https://www.upcloud.com/
+
+UpCloud currently operates globally from six (6) data centres:
+
+* Amsterdam, Netherlands
+* Chicago, USA
+* Frankfurt, Germany
+* Helsinki, Finland
+* London, UK
+* Singapore, Singapore
+
+Instantiating a driver
+--
+
+When you instantiate a driver you need to pass the following arguments to the
+driver constructor:
+
+* ``username`` - Your API access enabled users username
+* ``password`` - Your API access enabled users password
+
+You can setup your API access enabled user account from 
https://my.upcloud.com/account
+
+.. _`UpCloud`: https://www.upcloud.com/



[12/14] libcloud git commit: Changed data centres to data centers

2017-09-26 Thread quentinp
Changed data centres to data centers

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/a2dc54a6
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a2dc54a6
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a2dc54a6

Branch: refs/heads/trunk
Commit: a2dc54a6f2abc070bfe167e1d6a1ec9686ba451e
Parents: d78edb8
Author: Ilari Mäkelä 
Authored: Tue Sep 26 12:53:00 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 docs/compute/drivers/upcloud.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2dc54a6/docs/compute/drivers/upcloud.rst
--
diff --git a/docs/compute/drivers/upcloud.rst b/docs/compute/drivers/upcloud.rst
index b9a0bf3..09ae874 100644
--- a/docs/compute/drivers/upcloud.rst
+++ b/docs/compute/drivers/upcloud.rst
@@ -1,14 +1,14 @@
 UpCloud Driver Documentation
 ===
 `UpCloud`_ is a Finnish IaaS provider offering high performance servers 
-from data centres based in multiple countries.
+from data centers based in multiple countries.
 
 .. figure:: /_static/images/provider_logos/upcloud.png
 :align: center
 :width: 300
 :target: https://www.upcloud.com/
 
-UpCloud currently operates globally from six (6) data centres:
+UpCloud currently operates globally from six (6) data centers:
 
 * Amsterdam, Netherlands
 * Chicago, USA



[02/14] libcloud git commit: renamed method from node_state to get_node_state

2017-09-26 Thread quentinp
renamed method from node_state to get_node_state

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/513b9110
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/513b9110
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/513b9110

Branch: refs/heads/trunk
Commit: 513b9110bf62946695f0a0a8b817c32e4ba12cbc
Parents: e7df948
Author: Mika Lackman 
Authored: Tue Sep 26 16:34:20 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 libcloud/common/upcloud.py   |  4 ++--
 libcloud/test/common/test_upcloud.py | 18 +-
 2 files changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/513b9110/libcloud/common/upcloud.py
--
diff --git a/libcloud/common/upcloud.py b/libcloud/common/upcloud.py
index 02413fc..b824664 100644
--- a/libcloud/common/upcloud.py
+++ b/libcloud/common/upcloud.py
@@ -108,7 +108,7 @@ class UpcloudNodeDestroyer(object):
 return self._do_destroy_node(node_id)
 
 def _do_destroy_node(self, node_id):
-state = self._operations.node_state(node_id)
+state = self._operations.get_node_state(node_id)
 if state == 'stopped':
 self._operations.destroy_node(node_id)
 return True
@@ -164,7 +164,7 @@ class UpcloudNodeOperations(object):
 method='POST',
 data=json.dumps(body))
 
-def node_state(self, node_id):
+def get_node_state(self, node_id):
 """
 Get the state of the node.
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/513b9110/libcloud/test/common/test_upcloud.py
--
diff --git a/libcloud/test/common/test_upcloud.py 
b/libcloud/test/common/test_upcloud.py
index 76dd9c1..2df8213 100644
--- a/libcloud/test/common/test_upcloud.py
+++ b/libcloud/test/common/test_upcloud.py
@@ -142,7 +142,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 self.destroyer = UpcloudNodeDestroyer(self.mock_operations, 
sleep_func=self.mock_sleep)
 
 def test_node_already_in_stopped_state(self):
-self.mock_operations.node_state.side_effect = ['stopped']
+self.mock_operations.get_node_state.side_effect = ['stopped']
 
 self.assertTrue(self.destroyer.destroy_node(1))
 
@@ -150,7 +150,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 self.mock_operations.destroy_node.assert_called_once_with(1)
 
 def test_node_in_error_state(self):
-self.mock_operations.node_state.side_effect = ['error']
+self.mock_operations.get_node_state.side_effect = ['error']
 
 self.assertFalse(self.destroyer.destroy_node(1))
 
@@ -158,7 +158,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 self.assertTrue(self.mock_operations.destroy_node.call_count == 0)
 
 def test_node_in_started_state(self):
-self.mock_operations.node_state.side_effect = ['started', 'stopped']
+self.mock_operations.get_node_state.side_effect = ['started', 
'stopped']
 
 self.assertTrue(self.destroyer.destroy_node(1))
 
@@ -166,7 +166,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 self.mock_operations.destroy_node.assert_called_once_with(1)
 
 def test_node_in_maintenace_state(self):
-self.mock_operations.node_state.side_effect = ['maintenance', 
'maintenance', None]
+self.mock_operations.get_node_state.side_effect = ['maintenance', 
'maintenance', None]
 
 self.assertTrue(self.destroyer.destroy_node(1))
 
@@ -176,7 +176,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 self.assertTrue(self.mock_operations.destroy_node.call_count == 0)
 
 def test_node_statys_in_started_state_for_awhile(self):
-self.mock_operations.node_state.side_effect = ['started', 'started', 
'stopped']
+self.mock_operations.get_node_state.side_effect = ['started', 
'started', 'stopped']
 
 self.assertTrue(self.destroyer.destroy_node(1))
 
@@ -187,7 +187,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
 
 def test_reuse(self):
 "Verify that internal flag self.destroyer._stop_node is handled 
properly"
-self.mock_operations.node_state.side_effect = ['started', 'stopped', 
'started', 'stopped']
+self.mock_operations.get_node_state.side_effect = ['started', 
'stopped', 'started', 'stopped']
 self.assertTrue(self.destroyer.destroy_node(1))
 self.assertTrue(self.destroyer.destroy_node(1))
 
@@ -195,16 +195,16 @@ class 

[13/14] libcloud git commit: docs: Fix upcloud.rst whitespace

2017-09-26 Thread quentinp
docs: Fix upcloud.rst whitespace


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

Branch: refs/heads/trunk
Commit: f37b7c01a6476dc5427e0a484cb5d427608455e5
Parents: 513b911
Author: Quentin Pradet 
Authored: Wed Sep 27 06:50:54 2017 +0400
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 docs/compute/drivers/upcloud.rst | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f37b7c01/docs/compute/drivers/upcloud.rst
--
diff --git a/docs/compute/drivers/upcloud.rst b/docs/compute/drivers/upcloud.rst
index 09ae874..e24b46c 100644
--- a/docs/compute/drivers/upcloud.rst
+++ b/docs/compute/drivers/upcloud.rst
@@ -1,6 +1,6 @@
 UpCloud Driver Documentation
 ===
-`UpCloud`_ is a Finnish IaaS provider offering high performance servers 
+`UpCloud`_ is a Finnish IaaS provider offering high performance servers
 from data centers based in multiple countries.
 
 .. figure:: /_static/images/provider_logos/upcloud.png
@@ -29,16 +29,16 @@ driver constructor:
 Enabling API access
 ---
 
-To allow API access to your UpCloud account, you first need to enable the API 
-permissions by visiting `My Account -> User accounts`_ in your UpCloud Control 
-Panel. We recommend you to set up a sub-account specifically for the API usage 
-with its own username and password, as it allows you to assign specific 
permissions 
+To allow API access to your UpCloud account, you first need to enable the API
+permissions by visiting `My Account -> User accounts`_ in your UpCloud Control
+Panel. We recommend you to set up a sub-account specifically for the API usage
+with its own username and password, as it allows you to assign specific 
permissions
 for increased security.
 
-Click **Add user** and fill in the required details, and check the 
-“**Allow API connections**” checkbox to enable API for the user. You can 
also 
-limit the API connections to a specific IP address or address range for 
additional 
-security. Once you are done entering the user information, hit the **Save** 
button 
+Click **Add user** and fill in the required details, and check the
+“**Allow API connections**” checkbox to enable API for the user. You can 
also
+limit the API connections to a specific IP address or address range for 
additional
+security. Once you are done entering the user information, hit the **Save** 
button
 at the bottom of the page to create the new username.
 
 .. _`UpCloud`: https://www.upcloud.com/



[03/14] libcloud git commit: Updated upcloud.rst

2017-09-26 Thread quentinp
Updated upcloud.rst

- Revised the wording
- Added 'Enabling API access' section

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/fdbd943b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fdbd943b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fdbd943b

Branch: refs/heads/trunk
Commit: fdbd943b103c1bd2873b5d9d2b67140fa6002cb7
Parents: 9a97e3b
Author: Ilari Mäkelä 
Authored: Tue Sep 26 10:47:18 2017 +0300
Committer: Quentin Pradet 
Committed: Wed Sep 27 07:04:33 2017 +0400

--
 docs/compute/drivers/upcloud.rst | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fdbd943b/docs/compute/drivers/upcloud.rst
--
diff --git a/docs/compute/drivers/upcloud.rst b/docs/compute/drivers/upcloud.rst
index 4c6a400..b9a0bf3 100644
--- a/docs/compute/drivers/upcloud.rst
+++ b/docs/compute/drivers/upcloud.rst
@@ -1,7 +1,7 @@
 UpCloud Driver Documentation
 ===
-`UpCloud`_ is a Finnish IaaS provider offering the most high performance 
-servers with extremely redundant infrastructure to the most demanding 
customers.
+`UpCloud`_ is a Finnish IaaS provider offering high performance servers 
+from data centres based in multiple countries.
 
 .. figure:: /_static/images/provider_logos/upcloud.png
 :align: center
@@ -26,6 +26,20 @@ driver constructor:
 * ``username`` - Your API access enabled users username
 * ``password`` - Your API access enabled users password
 
-You can setup your API access enabled user account from 
https://my.upcloud.com/account
+Enabling API access
+---
+
+To allow API access to your UpCloud account, you first need to enable the API 
+permissions by visiting `My Account -> User accounts`_ in your UpCloud Control 
+Panel. We recommend you to set up a sub-account specifically for the API usage 
+with its own username and password, as it allows you to assign specific 
permissions 
+for increased security.
+
+Click **Add user** and fill in the required details, and check the 
+“**Allow API connections**” checkbox to enable API for the user. You can 
also 
+limit the API connections to a specific IP address or address range for 
additional 
+security. Once you are done entering the user information, hit the **Save** 
button 
+at the bottom of the page to create the new username.
 
 .. _`UpCloud`: https://www.upcloud.com/
+.. _`My Account -> User accounts`: https://my.upcloud.com/account



[GitHub] libcloud pull request #1045: Add test to check that can list sizes for all v...

2017-09-26 Thread fjros
Github user fjros closed the pull request at:

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


---