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 2013/08/04 20:24:53 UTC
[2/9] git commit: docs: Modify generate providers table script to
support detection of deploy_node feature.
docs: Modify generate providers table script to support detection of deploy_node
feature.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2b04dfb2
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2b04dfb2
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2b04dfb2
Branch: refs/heads/trunk
Commit: 2b04dfb20c17e02bbe2663f87a52c126d3935b78
Parents: 4059174
Author: Tomaz Muraus <to...@apache.org>
Authored: Sun Aug 4 15:11:06 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Aug 4 15:11:06 2013 +0200
----------------------------------------------------------------------
contrib/generate_provider_feature_matrix_table.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2b04dfb2/contrib/generate_provider_feature_matrix_table.py
----------------------------------------------------------------------
diff --git a/contrib/generate_provider_feature_matrix_table.py b/contrib/generate_provider_feature_matrix_table.py
index afdcfb7..55fac04 100755
--- a/contrib/generate_provider_feature_matrix_table.py
+++ b/contrib/generate_provider_feature_matrix_table.py
@@ -40,7 +40,8 @@ from libcloud.dns.types import Provider as DNSProvider
BASE_API_METHODS = {
'compute_main': ['list_nodes', 'create_node', 'reboot_node',
- 'destroy_node', 'list_images', 'list_sizes'],
+ 'destroy_node', 'list_images', 'list_sizes',
+ 'deploy_node'],
'compute_block_storage': ['list_volumes', 'create_volume',
'destroy_volume',
'attach_volume', 'detach_volume',
@@ -65,7 +66,8 @@ FRIENDLY_METHODS_NAMES = {
'reboot_node': 'reboot node',
'destroy_node': 'destroy node',
'list_images': 'list images',
- 'list_sizes': 'list sizes'
+ 'list_sizes': 'list sizes',
+ 'deploy_node': 'deploy node'
},
'compute_block_storage': {
'list_volumes': 'list volumes',
@@ -166,8 +168,14 @@ def generate_providers_table(api):
for method_name in base_api_methods:
base_method = base_methods[method_name]
driver_method = driver_methods[method_name]
- is_implemented = (id(driver_method.im_func) !=
- id(base_method.im_func))
+
+ if method_name == 'deploy_node':
+ features = getattr(cls, 'features', {}).get('create_node', [])
+ is_implemented = len(features) >= 1
+ else:
+ is_implemented = (id(driver_method.im_func) !=
+ id(base_method.im_func))
+
result[name]['methods'][method_name] = is_implemented
return result