Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move ServiceConfig building code into SystemConfig

  • Loading branch information...
commit 1208134ebd3da0e72af7ceef3c5a6a9692f9bd5f 1 parent e69ece1
@drnic drnic authored
View
15 lib/bosh-cloudfoundry/config/system_config.rb
@@ -63,4 +63,19 @@ def microbosh
end
@microbosh ||= Bosh::CloudFoundry::Config::MicroboshConfig.new(bosh_target)
end
+
+ def supported_services
+ %w[postgresql redis]
+ end
+
+ def service(service_name)
+ case service_name.to_sym
+ when :postgresql
+ Bosh::CloudFoundry::Config::PostgresqlServiceConfig.build_from_system_config(self)
+ when :redis
+ Bosh::CloudFoundry::Config::RedisServiceConfig.build_from_system_config(self)
+ else
+ raise "please add #{service_name} support to SystemConfig#service method"
+ end
+ end
end
View
11 lib/bosh/cli/commands/cf.rb
@@ -571,18 +571,11 @@ def validate_service_name(service_name)
end
def supported_services
- %w[postgresql redis]
+ system_config.supported_services
end
def service_config(service_name)
- case service_name.to_sym
- when :postgresql
- Bosh::CloudFoundry::Config::PostgresqlServiceConfig.build_from_system_config(system_config)
- when :redis
- Bosh::CloudFoundry::Config::RedisServiceConfig.build_from_system_config(system_config)
- else
- raise "please add #{service_name} support to #service_config method"
- end
+ system_config.service(service_name)
end
def default_core_server_flavor
Please sign in to comment.
Something went wrong with that request. Please try again.