Skip to content

Commit

Permalink
HUE-3528 [oozie] Call correct metrics api to avoid 500 error
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-krish committed Apr 8, 2016
1 parent ddb0328 commit 18a114f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions desktop/libs/liboozie/src/liboozie/conf.py
Expand Up @@ -82,9 +82,16 @@ def config_validator(user):
if 'NORMAL' not in status:
res.append((status, _('The Oozie server is not available')))

api = get_oozie(user)
intrumentation = api.get_instrumentation()
sharelib_url = [param['value'] for group in intrumentation['variables'] for param in group['data'] if param['name'] == 'sharelib.system.libpath']
api = get_oozie(user, api_version="v2")

configuration = api.get_configuration()
if 'org.apache.oozie.service.MetricsInstrumentationService' in [c.strip() for c in configuration.get('oozie.services.ext', '').split(',')]:
metrics = api.get_metrics()
sharelib_url = 'gauges' in metrics and 'libs.sharelib.system.libpath' in metrics['gauges'] and [metrics['gauges']['libs.sharelib.system.libpath']['value']] or []
else:
intrumentation = api.get_instrumentation()
sharelib_url = [param['value'] for group in intrumentation['variables'] for param in group['data'] if param['name'] == 'sharelib.system.libpath']

if sharelib_url:
sharelib_url = Hdfs.urlsplit(sharelib_url[0])[2]

Expand Down

0 comments on commit 18a114f

Please sign in to comment.