Revision cb47b287 snf-cyclades-app/synnefo/ui/settings.py
b/snf-cyclades-app/synnefo/ui/settings.py | ||
---|---|---|
62 | 62 |
USER_CATALOG_URL = join_urls(ACCOUNT_URL, 'user_catalogs') |
63 | 63 |
FEEDBACK_URL = join_urls(ACCOUNT_URL, 'feedback') |
64 | 64 |
|
65 |
|
|
66 |
class LazyAstakosUrl(object): |
|
67 |
def __init__(self, endpoints_name): |
|
68 |
self.endpoints_name = endpoints_name |
|
69 |
|
|
70 |
def __str__(self): |
|
71 |
if not hasattr(self, 'str'): |
|
72 |
try: |
|
73 |
astakos_client = \ |
|
74 |
AstakosClient(cyclades_settings.SERVICE_TOKEN, |
|
75 |
settings.ASTAKOS_AUTH_URL) |
|
76 |
self.str = getattr(astakos_client, self.endpoints_name) |
|
77 |
except Exception, e: |
|
78 |
logger.exception(e) |
|
79 |
return '' |
|
80 |
return self.str |
|
81 |
|
|
82 |
LOGIN_URL = join_urls(str(LazyAstakosUrl('ui_url')), 'login') |
|
65 |
LOGIN_URL = join_urls('/', cyclades.ASTAKOS_UI_PROXY_PATH, 'login') |
|
83 | 66 |
LOGOUT_REDIRECT = LOGIN_URL |
Also available in: Unified diff