Fix ssh duplicate key error
This this error while trying to add an ssh key
[2019-09-16 11:38:13,335][ERROR ][192.222.177.85][none][CP Server Thread-12][rdiffweb.rdw_app] The server encountered an unexpected condition which prevented it from fulfilling the request.
Traceback (most recent call last):
File "/opt/minarca/lib/python3.5/site-packages/rdiffweb/controller/pref_sshkeys.py", line 57, in _handle_add
self.app.currentuser.add_authorizedkey(key=kwargs['key'], comment=kwargs.get('title', None))
File "/opt/minarca/lib/python3.5/site-packages/rdiffweb/core/user.py", line 255, in add_authorizedkey
raise ValueError(_("SSH key already exists"))
ValueError: SSH key already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/minarca/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 628, in respond
self._do_respond(path_info)
File "/opt/minarca/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 687, in _do_respond
response.body = self.handler()
File "/opt/minarca/lib/python3.5/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/opt/minarca/lib/python3.5/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
File "/opt/minarca/lib/python3.5/site-packages/rdiffweb/controller/page_prefs.py", line 58, in index
template, params = provider.render_prefs_panel(panelid, **kwargs)
File "/opt/minarca/lib/python3.5/site-packages/rdiffweb/controller/pref_sshkeys.py", line 84, in render_prefs_panel
self._handle_add(**kwargs)
File "/opt/minarca/lib/python3.5/site-packages/rdiffweb/controller/pref_sshkeys.py", line 60, in _handle_add
raise RdiffWarning(e.message)
AttributeError: 'ValueError' object has no attribute 'message'
Edited by Patrik Dufresne