Add CF diagnostic logs for CF to payment app
This commit is contained in:
@@ -13,9 +13,13 @@ class Publisher:
|
|||||||
self._logger = logger
|
self._logger = logger
|
||||||
|
|
||||||
if 'VCAP_SERVICES' in os.environ:
|
if 'VCAP_SERVICES' in os.environ:
|
||||||
|
self._logger.info('Cloud Foundry detected')
|
||||||
|
|
||||||
env = AppEnv()
|
env = AppEnv()
|
||||||
amqp_service = env.get_service(binding_name='dispatch_queue')
|
amqp_service = env.get_service(binding_name='dispatch_queue')
|
||||||
|
|
||||||
|
self._logger.info('Service binding \'{binding_name}\' found'.format(binding_name='dispatch_queue'))
|
||||||
|
|
||||||
self._uri = amqp_service.credentials.get('uri')
|
self._uri = amqp_service.credentials.get('uri')
|
||||||
else:
|
else:
|
||||||
self._uri = 'ampq://{user}:{pwd}@{host}:{port}/{vhost}'.format(
|
self._uri = 'ampq://{user}:{pwd}@{host}:{port}/{vhost}'.format(
|
||||||
|
Reference in New Issue
Block a user