libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [2/5] git commit: Modify fixture generation script to treat list_records and list_zones as implemented if iterate_records and iterate_zones method is implemented.
Date Sat, 07 Dec 2013 14:56:17 GMT
Modify fixture generation script to treat list_records and list_zones as
implemented if iterate_records and iterate_zones method is implemented.

Also fix the script to preserver correct order.


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

Branch: refs/heads/trunk
Commit: d39b43d28fee4951bed0ad8633f1ac8e63230764
Parents: b0222db
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Sat Dec 7 15:45:23 2013 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sat Dec 7 15:46:17 2013 +0100

----------------------------------------------------------------------
 .../generate_provider_feature_matrix_table.py   | 26 +++++++++++++++++---
 1 file changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d39b43d2/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 db4d1f5..dd8f569 100755
--- a/contrib/generate_provider_feature_matrix_table.py
+++ b/contrib/generate_provider_feature_matrix_table.py
@@ -62,8 +62,9 @@ BASE_API_METHODS = {
                      'download_object_as_stream', 'delete_object'],
     'storage_cdn': ['enable_container_cdn', 'enable_object_cdn',
                     'get_container_cdn_url', 'get_object_cdn_url'],
-    'dns': ['list_zones', 'list_records', 'create_zone', 'update_zone',
-            'create_record', 'update_record', 'delete_zone', 'delete_record']
+    'dns': ['list_zones', 'list_records', 'iterate_zones', 'iterate_records',
+            'create_zone', 'update_zone', 'create_record', 'update_record',
+            'delete_zone', 'delete_record']
 }
 
 FRIENDLY_METHODS_NAMES = {
@@ -211,7 +212,7 @@ def generate_supported_methods_table(api, provider_matrix):
     base_api_methods = BASE_API_METHODS[api]
     data = []
     header = [FRIENDLY_METHODS_NAMES[api][method_name] for method_name in
-              base_api_methods]
+              base_api_methods if not method_name.startswith('iterate_')]
     data.append(['Provider'] + header)
 
     for provider, values in sorted(provider_matrix.items()):
@@ -220,7 +221,24 @@ def generate_supported_methods_table(api, provider_matrix):
 
         provider_name = '`%s`_' % (values['name'])
         row = [provider_name]
-        for _, supported in values['methods'].items():
+
+        if api == 'dns':
+            # TODO: Make it nicer
+            # list_zones and list_records don't need to be implemented if
+            # iterate_* methods are implemented
+            if values['methods']['iterate_zones']:
+                values['methods']['list_zones'] = True
+
+            if values['methods']['iterate_records']:
+                values['methods']['list_records'] = True
+
+        for method in base_api_methods:
+            # TODO: ghetto
+            if api == 'dns' and method.startswith('iterate_'):
+                continue
+
+            supported = values['methods'][method]
+
             if supported:
                 row.append('yes')
             else:


Mime
View raw message