You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/07/15 21:29:54 UTC
[libcloud] branch trunk updated (46193f7 -> 9695a9f)
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.
from 46193f7 Merge pull request #1313 from Kami/add_stale_bot_config
add f22988e Add a new driver supporting the gridscale platform
new 1e83bc1 changed auth param in create_node and functionality regarding auth param
new ee17f70 changed patch function names to be more accurate.
new 294501f adjusted docstrings in rename functions
new 6827f7f removed NodeAuthSSHKey class import
new e86ec64 changed mutable default param in _create_volume_from_template
new 454ed2b fixed typo in exception in create_node
new 3e7ca9f fixed typo in ex_rename_storage
new 1f1c193 added param to make time sleep interval user editable, adjusted docstrings accordingly
new 375f245 removed redundant continue statement
new 6ebc9af Merge branch 'gridscale-driver' of https://github.com/gridscale/libcloud into gridscale-gridscale-driver
new 7651f31 Fix invalid syntax.
new a3789b8 Add missing secrets.py entry.
new 8a9785e Fix syntax, update out of date test, update docstring.
new bd99762 Fix lint, store additional info on SSHKey extra dictionary, update example.
new eee4f43 Add features entry to the driver class to indicate that it support pub key based deploy_node() functionality.
new 246b88b Add changelog entry.
new 6f6673e Bail early if driver doesn't implement a method.
new 63cd1cb Fix name attribute.
new 9695a9f Re-generate supported providers tables.
The 19 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGES.rst | 3 +
contrib/generate_provider_feature_matrix_table.py | 8 +-
docs/_static/images/provider_logos/gridscale.png | Bin 0 -> 8369 bytes
docs/compute/_supported_methods_block_storage.rst | 4 +-
.../_supported_methods_image_management.rst | 2 +
.../_supported_methods_key_pair_management.rst | 2 +
docs/compute/_supported_methods_main.rst | 2 +
docs/compute/_supported_providers.rst | 2 +
docs/compute/drivers/gridscale.rst | 39 +
docs/examples/compute/gridscale/create_node.py | 22 +
.../compute/gridscale/instantiate_driver.py | 6 +
libcloud/common/gridscale.py | 120 +++
libcloud/compute/drivers/gridscale.py | 985 +++++++++++++++++++++
libcloud/compute/providers.py | 4 +-
libcloud/compute/types.py | 2 +
.../compute/fixtures/gridscale/create_image.json | 4 +
.../fixtures/gridscale/create_image_dict.json | 25 +
.../test/compute/fixtures/gridscale/create_ip.json | 5 +
.../gridscale/create_ip_response_dict.json | 182 ++++
.../compute/fixtures/gridscale/create_network.json | 37 +
.../compute/fixtures/gridscale/create_node.json | 5 +
.../fixtures/gridscale/create_node_dict.json | 83 ++
.../gridscale/create_node_response_dict.json | 7 +
.../compute/fixtures/gridscale/create_volume.json | 4 +
.../gridscale/create_volume_response_dict.json | 37 +
.../compute/fixtures/gridscale/ex_list_ips.json | 34 +
.../fixtures/gridscale/ex_list_networks.json | 37 +
.../compute/fixtures/gridscale/ex_start_node.json | 0
.../test/compute/fixtures/gridscale/get_image.json | 23 +
.../compute/fixtures/gridscale/ips_to_node.json | 0
.../compute/fixtures/gridscale/list_images.json | 588 ++++++++++++
.../compute/fixtures/gridscale/list_key_pairs.json | 24 +
.../compute/fixtures/gridscale/list_locations.json | 20 +
.../compute/fixtures/gridscale/list_nodes.json | 85 ++
.../fixtures/gridscale/list_volume_snapshots.json | 22 +
.../compute/fixtures/gridscale/list_volumes.json | 39 +
.../fixtures/gridscale/list_volumes_empty.json | 3 +
.../fixtures/gridscale/network_to_node.json | 35 +
.../compute/fixtures/gridscale/volume_to_node.json | 0
libcloud/test/compute/test_gridscale.py | 270 ++++++
libcloud/test/secrets.py-dist | 1 +
41 files changed, 2767 insertions(+), 4 deletions(-)
create mode 100644 docs/_static/images/provider_logos/gridscale.png
create mode 100644 docs/compute/drivers/gridscale.rst
create mode 100644 docs/examples/compute/gridscale/create_node.py
create mode 100644 docs/examples/compute/gridscale/instantiate_driver.py
create mode 100644 libcloud/common/gridscale.py
create mode 100644 libcloud/compute/drivers/gridscale.py
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_image.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_image_dict.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_ip.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_ip_response_dict.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_network.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_node.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_node_dict.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_node_response_dict.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_volume.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/create_volume_response_dict.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/ex_list_ips.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/ex_list_networks.json
copy pylint_plugins/__init__.py => libcloud/test/compute/fixtures/gridscale/ex_start_node.json (100%)
create mode 100644 libcloud/test/compute/fixtures/gridscale/get_image.json
copy pylint_plugins/__init__.py => libcloud/test/compute/fixtures/gridscale/ips_to_node.json (100%)
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_images.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_key_pairs.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_locations.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_nodes.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_volume_snapshots.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_volumes.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/list_volumes_empty.json
create mode 100644 libcloud/test/compute/fixtures/gridscale/network_to_node.json
copy pylint_plugins/__init__.py => libcloud/test/compute/fixtures/gridscale/volume_to_node.json (100%)
create mode 100644 libcloud/test/compute/test_gridscale.py
[libcloud] 07/19: fixed typo in ex_rename_storage
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 3e7ca9f286e1ccf50fbb5e1e967cfce0454873f0
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:45:32 2019 +0200
fixed typo in ex_rename_storage
---
libcloud/compute/drivers/gridscale.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 3fdfabb..b160620 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -563,7 +563,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
:rtype: ``bool``
"""
result = self._sync_request(data=json.dumps({'name': name}),
- endpoint='objects/servers/{}'
+ endpoint='objects/storages/{}'
.format(storage.id),
method='PATCH')
return result.status == 204
[libcloud] 12/19: Add missing secrets.py entry.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit a3789b82014afb1cfe5659e5bf0266bcd941f36c
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 22:59:24 2019 +0200
Add missing secrets.py entry.
---
libcloud/test/secrets.py-dist | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcloud/test/secrets.py-dist b/libcloud/test/secrets.py-dist
index 7bbcf6a..638e17d 100644
--- a/libcloud/test/secrets.py-dist
+++ b/libcloud/test/secrets.py-dist
@@ -60,6 +60,7 @@ PACKET_PARAMS = ('api_key')
ECS_PARAMS = ('access_key', 'access_secret')
CLOUDSCALE_PARAMS = ('token',)
UPCLOUD_PARAMS = ('user', 'secret')
+GRIDSCALE_PARAMS = ('user uuid', 'api token')
# Storage
STORAGE_S3_PARAMS = ('key', 'secret')
[libcloud] 03/19: adjusted docstrings in rename functions
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 294501f0c9b345a75f56f46f9f2a38a9769233a2
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:29:28 2019 +0200
adjusted docstrings in rename functions
---
libcloud/compute/drivers/gridscale.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 86e4253..8c08d2e 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -531,13 +531,13 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
def ex_rename_node(self, node, name=None):
"""
- change node name
+ Modify node name.
- :param name: new name
+ :param name: New node name.
:type name: ``str``
- :param node: Server you want to patch
- :type node: ``str``
+ :param node: Node
+ :type node: :class:`.Node`
:return: ``True`` or ``False``
:rtype: ``bool``
@@ -550,12 +550,12 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
def ex_rename_storage(self, storage, name=None):
"""
- modify storage name
+ Modify storage name
- :param storage: storage object
- :type storage: ``object``
+ :param storage: Storage.
+ :type storage: :class:.`StorageVolume`
- :param name: rename storage
+ :param name: New storage name.
:type name: ``str``
:return: ``True`` or ``False``
@@ -571,10 +571,10 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
"""
Modify networks name.
- :param network: Network object.
+ :param network: Network.
:type network: :class:`.GridscaleNetwork`
- :param name: New name.
+ :param name: New network name.
:type name: ``str``
:return: ``True`` or ``False``
[libcloud] 01/19: changed auth param in create_node and
functionality regarding auth param
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 1e83bc1272e0033ae64a4723ed498b1a51bfbabe
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:18:19 2019 +0200
changed auth param in create_node and functionality regarding auth param
---
libcloud/compute/drivers/gridscale.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 37a65c6..22a5296 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -201,7 +201,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
templates.append(template)
return sorted(templates, key=lambda sort: sort.name)
- def create_node(self, name, size, image, location, auth):
+ def create_node(self, name, size, image, location, ex_ssh_key_ids=None):
"""
Create a simple node with a name, cores, memory at the designated
location.
@@ -218,14 +218,13 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
:param location: The data center to create a node in.
:type location: :class:`.NodeLocation`
- :param auth: sshkey uuid.
- :type auth: :class:`.NodeAuthSSHKey`
+ :keyword ex_ssh_key_ids: sshkey uuid.
+ :type ex_ssh_key_ids: ``str``
:return: The newly created Node.
:rtype: :class:`.Node`
"""
- auth = NodeAuthSSHKey(auth)
if size.ram % 1024 != 0:
raise Exception('Value not accepted. Use a multiple of 1024 e.g.'
@@ -249,7 +248,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
location=location,
template={
'template_uuid': image.id,
- 'sshkeys': auth.pubkey})
+ 'sshkeys': ex_ssh_key_ids})
ip = self.ex_create_ip(4, location, name + '_ip')
[libcloud] 19/19: Re-generate supported providers tables.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 9695a9f8191eaf50b3fbb17d2562221dfbbb005f
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:27:46 2019 +0200
Re-generate supported providers tables.
---
docs/compute/_supported_methods_block_storage.rst | 4 +++-
docs/compute/_supported_methods_image_management.rst | 2 ++
docs/compute/_supported_methods_key_pair_management.rst | 2 ++
docs/compute/_supported_methods_main.rst | 2 ++
docs/compute/_supported_providers.rst | 2 ++
5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/docs/compute/_supported_methods_block_storage.rst b/docs/compute/_supported_methods_block_storage.rst
index 2b02314..a62d067 100644
--- a/docs/compute/_supported_methods_block_storage.rst
+++ b/docs/compute/_supported_methods_block_storage.rst
@@ -25,6 +25,7 @@ Provider list volumes create volume destroy volume
`Gandi`_ yes yes yes yes yes no no
`Google Compute Engine`_ yes yes yes yes yes yes yes
`GoGrid`_ no no no no no no no
+`Gridscale`_ yes yes yes yes yes yes yes
`HostVirtual`_ no no no no no no no
`Ikoula`_ yes yes yes yes yes no yes
`Indosat`_ no no no no no no no
@@ -47,7 +48,7 @@ Provider list volumes create volume destroy volume
`Outscale INC`_ yes yes yes yes yes yes yes
`Outscale SAS`_ yes yes yes yes yes yes yes
`Ovh`_ yes yes yes yes yes yes yes
-`Packet`_ no no no no no no no
+`Packet`_ yes yes yes yes yes yes yes
`ProfitBricks`_ yes yes yes yes yes no yes
`Rackspace Cloud (Next Gen)`_ yes yes yes yes yes yes yes
`Rackspace Cloud (First Gen)`_ yes yes yes yes yes no no
@@ -87,6 +88,7 @@ Provider list volumes create volume destroy volume
.. _`Gandi`: http://www.gandi.net/
.. _`Google Compute Engine`: https://cloud.google.com/
.. _`GoGrid`: http://www.gogrid.com/
+.. _`Gridscale`: https://gridscale.io
.. _`HostVirtual`: http://www.hostvirtual.com
.. _`Ikoula`: http://express.ikoula.co.uk/cloudstack
.. _`Indosat`: http://www.indosat.com/
diff --git a/docs/compute/_supported_methods_image_management.rst b/docs/compute/_supported_methods_image_management.rst
index 1d28dd2..0c90e11 100644
--- a/docs/compute/_supported_methods_image_management.rst
+++ b/docs/compute/_supported_methods_image_management.rst
@@ -25,6 +25,7 @@ Provider list images get image create image delete
`Gandi`_ yes no no no no
`Google Compute Engine`_ yes no no no no
`GoGrid`_ yes no no no no
+`Gridscale`_ yes yes yes yes no
`HostVirtual`_ yes no no no no
`Ikoula`_ yes no no no no
`Indosat`_ yes no no no no
@@ -87,6 +88,7 @@ Provider list images get image create image delete
.. _`Gandi`: http://www.gandi.net/
.. _`Google Compute Engine`: https://cloud.google.com/
.. _`GoGrid`: http://www.gogrid.com/
+.. _`Gridscale`: https://gridscale.io
.. _`HostVirtual`: http://www.hostvirtual.com
.. _`Ikoula`: http://express.ikoula.co.uk/cloudstack
.. _`Indosat`: http://www.indosat.com/
diff --git a/docs/compute/_supported_methods_key_pair_management.rst b/docs/compute/_supported_methods_key_pair_management.rst
index bc4a5f9..d9d71c4 100644
--- a/docs/compute/_supported_methods_key_pair_management.rst
+++ b/docs/compute/_supported_methods_key_pair_management.rst
@@ -25,6 +25,7 @@ Provider list key pairs get key pair create key pai
`Gandi`_ yes yes no yes no yes
`Google Compute Engine`_ no no no no no no
`GoGrid`_ no no no no no no
+`Gridscale`_ yes no no no no no
`HostVirtual`_ no no no no no no
`Ikoula`_ yes yes yes yes no yes
`Indosat`_ no no no no no no
@@ -87,6 +88,7 @@ Provider list key pairs get key pair create key pai
.. _`Gandi`: http://www.gandi.net/
.. _`Google Compute Engine`: https://cloud.google.com/
.. _`GoGrid`: http://www.gogrid.com/
+.. _`Gridscale`: https://gridscale.io
.. _`HostVirtual`: http://www.hostvirtual.com
.. _`Ikoula`: http://express.ikoula.co.uk/cloudstack
.. _`Indosat`: http://www.indosat.com/
diff --git a/docs/compute/_supported_methods_main.rst b/docs/compute/_supported_methods_main.rst
index 41f7994..cc75ad1 100644
--- a/docs/compute/_supported_methods_main.rst
+++ b/docs/compute/_supported_methods_main.rst
@@ -25,6 +25,7 @@ Provider list nodes create node reboot node destroy
`Gandi`_ yes yes yes yes yes yes no
`Google Compute Engine`_ yes yes yes yes yes yes no
`GoGrid`_ yes yes yes yes yes yes yes
+`Gridscale`_ yes yes yes yes yes no yes
`HostVirtual`_ yes yes yes yes yes yes yes
`Ikoula`_ yes yes yes yes yes yes yes
`Indosat`_ yes yes yes yes yes yes yes
@@ -87,6 +88,7 @@ Provider list nodes create node reboot node destroy
.. _`Gandi`: http://www.gandi.net/
.. _`Google Compute Engine`: https://cloud.google.com/
.. _`GoGrid`: http://www.gogrid.com/
+.. _`Gridscale`: https://gridscale.io
.. _`HostVirtual`: http://www.hostvirtual.com
.. _`Ikoula`: http://express.ikoula.co.uk/cloudstack
.. _`Indosat`: http://www.indosat.com/
diff --git a/docs/compute/_supported_providers.rst b/docs/compute/_supported_providers.rst
index 74d4c7c..19d7396 100644
--- a/docs/compute/_supported_providers.rst
+++ b/docs/compute/_supported_providers.rst
@@ -25,6 +25,7 @@ Provider Documentation
`Gandi`_ :doc:`Click </compute/drivers/gandi>` GANDI single region driver :mod:`libcloud.compute.drivers.gandi` :class:`GandiNodeDriver`
`Google Compute Engine`_ :doc:`Click </compute/drivers/gce>` GCE single region driver :mod:`libcloud.compute.drivers.gce` :class:`GCENodeDriver`
`GoGrid`_ GOGRID single region driver :mod:`libcloud.compute.drivers.gogrid` :class:`GoGridNodeDriver`
+`Gridscale`_ :doc:`Click </compute/drivers/gridscale>` GRIDSCALE single region driver :mod:`libcloud.compute.drivers.gridscale` :class:`GridscaleNodeDriver`
`HostVirtual`_ HOSTVIRTUAL single region driver :mod:`libcloud.compute.drivers.hostvirtual` :class:`HostVirtualNodeDriver`
`Ikoula`_ :doc:`Click </compute/drivers/ikoula>` IKOULA single region driver :mod:`libcloud.compute.drivers.ikoula` :class:`IkoulaNodeDriver`
`Indosat`_ :doc:`Click </compute/drivers/indosat>` INDOSAT single region driver :mod:`libcloud.compute.drivers.indosat` :class:`IndosatNodeDriver`
@@ -87,6 +88,7 @@ Provider Documentation
.. _`Gandi`: http://www.gandi.net/
.. _`Google Compute Engine`: https://cloud.google.com/
.. _`GoGrid`: http://www.gogrid.com/
+.. _`Gridscale`: https://gridscale.io
.. _`HostVirtual`: http://www.hostvirtual.com
.. _`Ikoula`: http://express.ikoula.co.uk/cloudstack
.. _`Indosat`: http://www.indosat.com/
[libcloud] 08/19: added param to make time sleep interval user
editable, adjusted docstrings accordingly
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 1f1c1937a98024d77181338c137b276b6677cc46
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 16:05:30 2019 +0200
added param to make time sleep interval user editable, adjusted docstrings accordingly
---
libcloud/compute/drivers/gridscale.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index b160620..351df7d 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -587,7 +587,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
method='PATCH')
return result.status == 204
- def reboot_node(self, node):
+ def reboot_node(self, node, ex_sleep_interval=3):
"""
Reboot a node.
@@ -597,6 +597,9 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
:return: True if the reboot was successful, otherwise False.
:rtype: ``bool``
+ :keyword ex_sleep_interval: time to let the shutdown process finish
+ :type ex_sleep_interval: ``int``
+
"""
if node.extra['power'] is True:
@@ -605,7 +608,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
endpoint='objects/servers/{}/power'
.format(node.id),
method='PATCH')
- time.sleep(3)
+ time.sleep(ex_sleep_interval)
data = dict({'power': True})
self._sync_request(data=json.dumps(data),
[libcloud] 16/19: Add changelog entry.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 246b88b3170526b12b0fd410cd8911fbb7a3408b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:20:33 2019 +0200
Add changelog entry.
---
CHANGES.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGES.rst b/CHANGES.rst
index 7321107..9e82268 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -86,6 +86,9 @@ Compute
alias in place.
[Tomaz Muraus]
+- [Gridscale] Add new driver for Gridscale provider (https://gridscale.io).
+ [Sydney Weber - @PrinceSydney]
+
Storage
~~~~~~~
[libcloud] 11/19: Fix invalid syntax.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 7651f312c06070b7d08e582649eca5ef2f32a6d6
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 22:59:15 2019 +0200
Fix invalid syntax.
---
libcloud/test/compute/test_gridscale.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcloud/test/compute/test_gridscale.py b/libcloud/test/compute/test_gridscale.py
index 45298cd..a053c6f 100644
--- a/libcloud/test/compute/test_gridscale.py
+++ b/libcloud/test/compute/test_gridscale.py
@@ -133,7 +133,7 @@ class Gridscale_Tests(LibcloudTestCase):
def test_list_nodes_fills_created_datetime(self):
nodes = self.driver.list_nodes()
- self.assertEqual(nodes[0].created_at, datetime(2019, 6, 7, 12, 56, 44, tzinfo=UTC)
+ self.assertEqual(nodes[0].created_at, datetime(2019, 6, 7, 12, 56, 44, tzinfo=UTC))
class GridscaleMockHttp(MockHttp):
fixtures = ComputeFileFixtures('gridscale')
[libcloud] 04/19: removed NodeAuthSSHKey class import
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 6827f7fd3e160274c5b93268a53163368e737129
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:30:02 2019 +0200
removed NodeAuthSSHKey class import
---
libcloud/compute/drivers/gridscale.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 8c08d2e..5041344 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -18,7 +18,7 @@ import time
from libcloud.common.gridscale import GridscaleBaseDriver
from libcloud.common.gridscale import GridscaleConnection
from libcloud.compute.base import NodeImage, NodeLocation, VolumeSnapshot, \
- Node, StorageVolume, KeyPair, NodeState, StorageVolumeState, NodeAuthSSHKey
+ Node, StorageVolume, KeyPair, NodeState, StorageVolumeState
from libcloud.compute.providers import Provider
from libcloud.utils.iso8601 import parse_date
[libcloud] 05/19: changed mutable default param in
_create_volume_from_template
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit e86ec64068cf41bfc5e0a5952357e7c60e0eaf85
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:41:45 2019 +0200
changed mutable default param in _create_volume_from_template
---
libcloud/compute/drivers/gridscale.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 5041344..315f1e2 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -336,7 +336,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
return self._create_volume_from_template(size, name, location)
def _create_volume_from_template(self, size, name, location=None,
- template={}):
+ template=None):
"""
create Storage
@@ -355,6 +355,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
:return: newly created StorageVolume
:rtype: :class:`.GridscaleVolumeStorage`
"""
+ template = template
self.connection.async_request(
'objects/storages/',
data=json.dumps({
[libcloud] 15/19: Add features entry to the driver class to
indicate that it support pub key based deploy_node() functionality.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit eee4f4367e3822b8a23ae5d0e285ea7aa0979371
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:18:12 2019 +0200
Add features entry to the driver class to indicate that it support pub
key based deploy_node() functionality.
---
libcloud/compute/drivers/gridscale.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 793eb24..9d19988 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -91,6 +91,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
type = Provider.GRIDSCALE
name = 'gridscale'
website = 'https://gridscale.io'
+ features = {'create_node': ['ssh_key']}
def __init__(self, user_id, key, **kwargs):
super(GridscaleNodeDriver, self).__init__(user_id, key, **kwargs)
[libcloud] 14/19: Fix lint,
store additional info on SSHKey extra dictionary, update example.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit bd9976248261ab768570cf1a5782d6eaa4d6b97b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:15:48 2019 +0200
Fix lint, store additional info on SSHKey extra dictionary, update
example.
---
docs/examples/compute/gridscale/create_node.py | 19 ++++++++++---------
libcloud/common/gridscale.py | 4 +++-
libcloud/compute/drivers/gridscale.py | 10 +++++++---
3 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/docs/examples/compute/gridscale/create_node.py b/docs/examples/compute/gridscale/create_node.py
index 0ee1660..572074c 100644
--- a/docs/examples/compute/gridscale/create_node.py
+++ b/docs/examples/compute/gridscale/create_node.py
@@ -1,21 +1,22 @@
from libcloud.compute.providers import get_driver
+from libcloud.compute.base import NodeSize
from libcloud.compute.type import Provider
driver = get_driver(Provider.GRIDSCALE)
driver = driver('USER-UUID', 'API-TOKEN')
-#We don't feature packages containing a fix size so you will have to
-#built your own size object. Make sure to use a multiple of 1024MB when asigning
-#RAM
+# We don't feature packages containing a fix size so you will have to
+# built your own size object. Make sure to use a multiple of 1024MB when
+# asigning RAM
+name = 'my-node-size'
+size = NodeSize(id=0, bandwidth=0, price=0, name=name, ram=10240,
+ driver=driver, extra={'cores': 2})
-size = NodeSize(id=0, bandwidth=0, price=0, name=name, ram=10240,
- driver=conn,extra={'cores': 2}
-
-#ssh_key uuid
-ssh_key = driver.list_key_pairs()[0].public_key
+ssh_key = driver.list_key_pairs()[0]
+ssh_key_uuid = ssh_key.fingerprint
name = 'MyServer'
location = driver.list_locations()[0]
image = driver.list_images()[0]
-node = driver.create_node(name , size, location, auth=ssh_key)
+node = driver.create_node(name, size, location, ex_ssh_key_ids=ssh_key)
diff --git a/libcloud/common/gridscale.py b/libcloud/common/gridscale.py
index 16b4f13..c80c130 100644
--- a/libcloud/common/gridscale.py
+++ b/libcloud/common/gridscale.py
@@ -81,7 +81,8 @@ class GridscaleConnection(ConnectionUserAndKey, PollingConnection):
def _poll_request_initial(self, **kwargs):
if self.async_request_counter == 0:
- self.poll_response_initial = super(GridscaleConnection, self).request(**kwargs)
+ self.poll_response_initial = super(GridscaleConnection, self) \
+ .request(**kwargs)
r = self.poll_response_initial
self.async_request_counter += 1
else:
@@ -103,6 +104,7 @@ class GridscaleConnection(ConnectionUserAndKey, PollingConnection):
return True
return False
+
class GridscaleBaseDriver(BaseDriver):
name = 'gridscale'
website = 'https://gridscale.io'
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 486493e..793eb24 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -645,8 +645,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
"""
response_dict = self._get_response_dict(self._sync_request(
- endpoint='/objects/templates/{}'
- .format(image_id)))
+ endpoint='/objects/templates/{}'.format(image_id)))
return self._to_node_image(response_dict)
@@ -919,8 +918,13 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
return template
def _to_key(self, data):
+ extra = {
+ 'uuid': data['object_uuid'],
+ 'labels': data.get('labels', [])
+ }
+
key = KeyPair(name=data['name'], fingerprint=data['object_uuid'],
- public_key=data['sshkey'], private_key=None, extra=None,
+ public_key=data['sshkey'], private_key=None, extra=extra,
driver=self.connection.driver)
return key
[libcloud] 09/19: removed redundant continue statement
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 375f24558437f5875d1f08247d4fc4044a38d96e
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 16:07:24 2019 +0200
removed redundant continue statement
---
libcloud/compute/drivers/gridscale.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 351df7d..93d5c64 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -107,7 +107,6 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
for key, value in self._get_response_dict(result).items():
node = self._to_node(value)
nodes.append(node)
- continue
return sorted(nodes, key=lambda sort: sort.created_at)
@@ -123,7 +122,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
for key, value in self._get_response_dict(result).items():
location = self._to_location(value)
locations.append(location)
- continue
+
return sorted(locations, key=lambda nod: nod.id)
def list_volumes(self):
[libcloud] 13/19: Fix syntax, update out of date test,
update docstring.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 8a9785ec52a446cf4db03c6d3af5c157e9a2691f
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:05:25 2019 +0200
Fix syntax, update out of date test, update docstring.
---
libcloud/common/gridscale.py | 2 +-
libcloud/compute/drivers/gridscale.py | 4 ++--
libcloud/test/compute/test_gridscale.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libcloud/common/gridscale.py b/libcloud/common/gridscale.py
index 62adb10..16b4f13 100644
--- a/libcloud/common/gridscale.py
+++ b/libcloud/common/gridscale.py
@@ -81,7 +81,7 @@ class GridscaleConnection(ConnectionUserAndKey, PollingConnection):
def _poll_request_initial(self, **kwargs):
if self.async_request_counter == 0:
- self.poll_response_initial = super().request(**kwargs)
+ self.poll_response_initial = super(GridscaleConnection, self).request(**kwargs)
r = self.poll_response_initial
self.async_request_counter += 1
else:
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 93d5c64..486493e 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -217,8 +217,8 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
:param location: The data center to create a node in.
:type location: :class:`.NodeLocation`
- :keyword ex_ssh_key_ids: sshkey uuid.
- :type ex_ssh_key_ids: ``str``
+ :keyword ex_ssh_key_ids: List of SSH key IDs to add to the server.
+ :type ex_ssh_key_ids: ``list`` of ``str``
:return: The newly created Node.
:rtype: :class:`.Node`
diff --git a/libcloud/test/compute/test_gridscale.py b/libcloud/test/compute/test_gridscale.py
index a053c6f..5117ff8 100644
--- a/libcloud/test/compute/test_gridscale.py
+++ b/libcloud/test/compute/test_gridscale.py
@@ -41,7 +41,7 @@ class Gridscale_Tests(LibcloudTestCase):
sshkey = ["b1682d3a-1869-4bdc-8ffe-e74a261d300c"]
GridscaleMockHttp.type = 'POST'
node = self.driver.create_node(name='test', size=size, image=image,
- location=location, auth=sshkey)
+ location=location, ex_ssh_key_ids=sshkey)
self.assertEqual(node.name, 'test.test')
self.assertEqual(node.public_ips, ['185.102.95.236', '2a06:2380:0:1::211'])
[libcloud] 10/19: Merge branch 'gridscale-driver' of
https://github.com/gridscale/libcloud into gridscale-gridscale-driver
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 6ebc9afff62d72257018ad944d15b060edd5d1b1
Merge: 46193f7 375f245
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 22:57:27 2019 +0200
Merge branch 'gridscale-driver' of https://github.com/gridscale/libcloud into gridscale-gridscale-driver
docs/_static/images/provider_logos/gridscale.png | Bin 0 -> 8369 bytes
docs/compute/drivers/gridscale.rst | 39 +
docs/examples/compute/gridscale/create_node.py | 21 +
.../compute/gridscale/instantiate_driver.py | 6 +
libcloud/common/gridscale.py | 118 +++
libcloud/compute/drivers/gridscale.py | 979 +++++++++++++++++++++
libcloud/compute/providers.py | 4 +-
libcloud/compute/types.py | 2 +
.../compute/fixtures/gridscale/create_image.json | 4 +
.../fixtures/gridscale/create_image_dict.json | 25 +
.../test/compute/fixtures/gridscale/create_ip.json | 5 +
.../gridscale/create_ip_response_dict.json | 182 ++++
.../compute/fixtures/gridscale/create_network.json | 37 +
.../compute/fixtures/gridscale/create_node.json | 5 +
.../fixtures/gridscale/create_node_dict.json | 83 ++
.../gridscale/create_node_response_dict.json | 7 +
.../compute/fixtures/gridscale/create_volume.json | 4 +
.../gridscale/create_volume_response_dict.json | 37 +
.../compute/fixtures/gridscale/ex_list_ips.json | 34 +
.../fixtures/gridscale/ex_list_networks.json | 37 +
.../compute/fixtures/gridscale/ex_start_node.json | 0
.../test/compute/fixtures/gridscale/get_image.json | 23 +
.../compute/fixtures/gridscale/ips_to_node.json | 0
.../compute/fixtures/gridscale/list_images.json | 588 +++++++++++++
.../compute/fixtures/gridscale/list_key_pairs.json | 24 +
.../compute/fixtures/gridscale/list_locations.json | 20 +
.../compute/fixtures/gridscale/list_nodes.json | 85 ++
.../fixtures/gridscale/list_volume_snapshots.json | 22 +
.../compute/fixtures/gridscale/list_volumes.json | 39 +
.../fixtures/gridscale/list_volumes_empty.json | 3 +
.../fixtures/gridscale/network_to_node.json | 35 +
.../compute/fixtures/gridscale/volume_to_node.json | 0
libcloud/test/compute/test_gridscale.py | 270 ++++++
33 files changed, 2737 insertions(+), 1 deletion(-)
[libcloud] 06/19: fixed typo in exception in create_node
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 454ed2baff898cbc5df4dfc058088c190c1251c1
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:43:29 2019 +0200
fixed typo in exception in create_node
---
libcloud/compute/drivers/gridscale.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 315f1e2..3fdfabb 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -228,7 +228,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
if size.ram % 1024 != 0:
raise Exception('Value not accepted. Use a multiple of 1024 e.g.'
- '1024, 2048, 3096...')
+ '1024, 2048, 3072...')
data = {
'name': name,
'cores': size.extra['cores'],
[libcloud] 02/19: changed patch function names to be more accurate.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit ee17f7059ba61a1beb7f29ec2c879adebe7ddd87
Author: Sydney Weber <Sy...@gridscale.io>
AuthorDate: Mon Jul 15 15:28:42 2019 +0200
changed patch function names to be more accurate.
---
libcloud/compute/drivers/gridscale.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 22a5296..86e4253 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -529,7 +529,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
method='DELETE')
return result.status == 204
- def patch_node(self, node, name=None):
+ def ex_rename_node(self, node, name=None):
"""
change node name
@@ -548,7 +548,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
method='PATCH')
return result.status == 204
- def patch_storage(self, storage, name=None):
+ def ex_rename_storage(self, storage, name=None):
"""
modify storage name
@@ -567,7 +567,7 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
method='PATCH')
return result.status == 204
- def ex_patch_networks(self, network, name=None):
+ def ex_rename_network(self, network, name=None):
"""
Modify networks name.
[libcloud] 17/19: Bail early if driver doesn't implement a method.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 6f6673e421a0bbd2e3d6dbc5fbc8208115bcdf23
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:23:33 2019 +0200
Bail early if driver doesn't implement a method.
---
contrib/generate_provider_feature_matrix_table.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/contrib/generate_provider_feature_matrix_table.py b/contrib/generate_provider_feature_matrix_table.py
index 57bb6e4..3d8b300 100755
--- a/contrib/generate_provider_feature_matrix_table.py
+++ b/contrib/generate_provider_feature_matrix_table.py
@@ -307,13 +307,17 @@ def generate_providers_table(api):
for method_name in base_api_methods:
base_method = base_methods[method_name]
- driver_method = driver_methods[method_name]
+
if method_name == 'deploy_node':
features = getattr(cls, 'features', {}).get('create_node', [])
is_implemented = len(features) >= 1
else:
- is_implemented = (id(driver_method) != id(base_method))
+ if method_name not in driver_methods:
+ is_implemented = False
+ else:
+ driver_method = driver_methods[method_name]
+ is_implemented = (id(driver_method) != id(base_method))
result[name]['methods'][method_name] = is_implemented
[libcloud] 18/19: Fix name attribute.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 63cd1cbc05911937c82a037e9f55023bb2f94ffc
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Jul 15 23:27:33 2019 +0200
Fix name attribute.
---
libcloud/compute/drivers/gridscale.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcloud/compute/drivers/gridscale.py b/libcloud/compute/drivers/gridscale.py
index 9d19988..611d7e7 100644
--- a/libcloud/compute/drivers/gridscale.py
+++ b/libcloud/compute/drivers/gridscale.py
@@ -89,7 +89,8 @@ class GridscaleNodeDriver(GridscaleBaseDriver):
"""
connectionCls = GridscaleConnection
type = Provider.GRIDSCALE
- name = 'gridscale'
+ name = 'Gridscale'
+ api_name = 'gridscale'
website = 'https://gridscale.io'
features = {'create_node': ['ssh_key']}