Permalink
Browse files

add support for per gw supported_plans

original commit I853465ad93d2268843f623b69a9280d6ef5366d3
cherry-picked to master from ccng-side-by-side branch

Change-Id: I227e596674ca15ad6a88fbcb4cef716595b009d7
  • Loading branch information...
1 parent dc27271 commit 5b49f6502f2deb0697ad47ddd49aadc7288a60d5 @pbozeman pbozeman committed with kushmerick Sep 18, 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 5b49f65

Please sign in to comment.