Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit nicely when ibqueryerrors is not executable #6

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

jbd
Copy link
Contributor

@jbd jbd commented Oct 20, 2020

Replace #5.

Prevents runtime exception when ibqueryerrors not installed or executable:

Before:

Traceback (most recent call last):
  File "infiniband-exporter.py", line 354, in <module>
    args.node_name_map))
  File "/usr/lib/python2.7/site-packages/prometheus_client/registry.py", line 24, in register
    names = self._get_names(collector)
  File "/usr/lib/python2.7/site-packages/prometheus_client/registry.py", line 64, in _get_names
    for metric in desc_func():
  File "infiniband-exporter.py", line 274, in collect
    stdout=subprocess.PIPE)
  File "/usr/lib64/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

After:

python2 infiniband-exporter.py 
Cannot find an executable ibqueryerrors binary in PATH

@guilbaults guilbaults merged commit f68829f into guilbaults:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants