Skip to content
Browse files

Merge "add support for per gw supported_plans"

  • Loading branch information...
2 parents 89b97be + 5b49f65 commit 0963f955f46662d2320239f1ae3728667f53e9d6 @kushmerick kushmerick committed with Gerrit Code Review Nov 9, 2012
View
7 jobs/memcached_gateway/templates/memcached_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/mongodb_gateway/templates/mongodb_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/mysql_gateway/templates/mysql_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/postgresql_gateway/templates/postgresql_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/rabbit_gateway/templates/rabbit_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/redis_gateway/templates/redis_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases
View
7 jobs/vblob_gateway/templates/vblob_gateway.yml.erb
@@ -5,7 +5,12 @@ gateway = eval("properties.#{service}_gateway")
acls = gateway.acls
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan_mgmt = plan_enabled && properties.service_plans.send(service.to_sym)
-plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+supported_plans = properties.supported_plans
+if supported_plans
+ plan_mgmt.instance_eval("def fields; @table.keys.select { |v| #{supported_plans}.include? v.to_s }; end;") if plan_mgmt
+else
+ plan_mgmt.instance_eval("def fields; @table.keys; end;") if plan_mgmt
+end
supported_versions = gateway.supported_versions
version_aliases = gateway.version_aliases
version_aliases.instance_eval("def fields; @table.keys; end;") if version_aliases

0 comments on commit 0963f95

Please sign in to comment.
Something went wrong with that request. Please try again.