|
5 | 5 | from oauth2_client.credentials_manager import CredentialManager, ServiceInformation
|
6 | 6 |
|
7 | 7 | from cloudfoundry_client.entities import InvalidStatusCode, EntityManager
|
8 |
| -from cloudfoundry_client.loggregator.loggregator import LoggregatorManager |
9 | 8 | from cloudfoundry_client.v2.apps import AppManager
|
10 | 9 | from cloudfoundry_client.v2.buildpacks import BuildpackManager
|
11 | 10 | from cloudfoundry_client.v2.service_bindings import ServiceBindingManager
|
@@ -38,7 +37,19 @@ def __init__(self, target_endpoint, client_id='cf', client_secret='', proxy=None
|
38 | 37 | self.spaces = EntityManager(target_endpoint, self, '/v2/spaces')
|
39 | 38 | self.services = EntityManager(target_endpoint, self, '/v2/services')
|
40 | 39 | self.routes = EntityManager(target_endpoint, self, '/v2/routes')
|
41 |
| - self.loggregator = LoggregatorManager(info['logging_endpoint'], self) |
| 40 | + try: |
| 41 | + from cloudfoundry_client.loggregator.loggregator import LoggregatorManager |
| 42 | + self._loggregator = LoggregatorManager(info['logging_endpoint'], self) |
| 43 | + except BaseException, ex: |
| 44 | + _logger.warning("Error while loading loggregator: %s", ex) |
| 45 | + self._loggregator = ex |
| 46 | + |
| 47 | + @property |
| 48 | + def loggregator(self): |
| 49 | + if isinstance(self._loggregator, BaseException): |
| 50 | + raise self._loggregator |
| 51 | + else: |
| 52 | + return self._loggregator |
42 | 53 |
|
43 | 54 | @staticmethod
|
44 | 55 | def get_info(target_endpoint, proxy=None, skip_verification=False):
|
|
0 commit comments