edf-hpc / hpcstats

HPC clusters data guzzler for usage statistics and metrics
http://edf-hpc.github.io/hpcstats/
GNU General Public License v2.0
5 stars 3 forks source link

Handle missing private key in launcher #3

Closed rezib closed 8 years ago

rezib commented 8 years ago

Example of backtrace:

Traceback (most recent call last):
  File "/usr/share/hpcstats/bin/launch-jobstats", line 92, in <module>
    main()
  File "/usr/share/hpcstats/bin/launch-jobstats", line 89, in main
    ssh_launch(user, frontend, privkey, script)
  File "/usr/share/hpcstats/bin/launch-jobstats", line 70, in ssh_launch
    ssh.connect(frontend, username=user, key_filename=privkey)
  File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 332, in connect
    self._auth(username, password, pkey, key_filenames, allow_agent, look_for_keys)
  File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 436, in _auth
    key = pkey_class.from_private_key_file(key_filename, password)
  File "/usr/lib/pymodules/python2.6/paramiko/pkey.py", line 198, in from_private_key_file
    key = cls(filename=filename, password=password)
  File "/usr/lib/pymodules/python2.6/paramiko/rsakey.py", line 51, in __init__
    self._from_private_key_file(filename, password)
  File "/usr/lib/pymodules/python2.6/paramiko/rsakey.py", line 163, in _from_private_key_file
    data = self._read_private_key_file('RSA', filename, password)
  File "/usr/lib/pymodules/python2.6/paramiko/pkey.py", line 279, in _read_private_key_file
    f = open(filename, 'r')
IOError: [Errno 2] No such file or directory: '/path/to/file'
rezib commented 8 years ago

Fixed with 7aeebf9.