Permalink
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.