You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
516 B
23 lines
516 B
module Configuration |
|
class PaasConfigurationService < ConfigurationService |
|
private |
|
|
|
def config_present? |
|
!ENV["VCAP_SERVICES"].nil? |
|
end |
|
|
|
def read_config |
|
unless config_present? |
|
@logger.warn("Could not find VCAP_SERVICES in the environment variables!") |
|
return {} |
|
end |
|
|
|
begin |
|
JSON.parse(ENV["VCAP_SERVICES"], { symbolize_names: true }) |
|
rescue StandardError |
|
@logger.warn("Could not parse VCAP_SERVICES!") |
|
{} |
|
end |
|
end |
|
end |
|
end
|
|
|