You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When e.g. calling ssh-ldap-pubkey add for an user that is still missing the sshPublicKey attribute there naturally is an error message. But the ldap errors are covered by all the lines of the python traceback:
# ssh-ldap-pubkey add -H ldaps://<ldap-server>/ .ssh/id_ed25519.pub
Enter login (LDAP) password for user '<username>':
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/ssh_ldap_pubkey/__init__.py", line 159, in add_pubkey
self._conn.modify_s(dn, modlist)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 631, in modify_s
return self.modify_ext_s(dn,modlist,None,None)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 604, in modify_ext_s
resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 751, in result3
resp_ctrl_classes=resp_ctrl_classes
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 758, in result4
ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 331, in _ldap_call
reraise(exc_type, exc_value, exc_traceback)
File "/usr/lib/python3.7/site-packages/ldap/compat.py", line 44, in reraise
raise exc_value
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 315, in _ldap_call
result = func(*args,**kwargs)
ldap.OBJECT_CLASS_VIOLATION: {'desc': 'Object class violation', 'info': "attribute 'sshPublicKey' not allowed"}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.7/ssh-ldap-pubkey", line 147, in <module>
main(**kwargs)
File "/usr/lib/python-exec/python3.7/ssh-ldap-pubkey", line 117, in main
ldapssh.add_pubkey(login, passw, pubkey)
File "/usr/lib/python3.7/site-packages/ssh_ldap_pubkey/__init__.py", line 163, in add_pubkey
self._conn.modify_s(dn, modlist)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 631, in modify_s
return self.modify_ext_s(dn,modlist,None,None)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 604, in modify_ext_s
resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 751, in result3
resp_ctrl_classes=resp_ctrl_classes
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 758, in result4
ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 331, in _ldap_call
reraise(exc_type, exc_value, exc_traceback)
File "/usr/lib/python3.7/site-packages/ldap/compat.py", line 44, in reraise
raise exc_value
File "/usr/lib/python3.7/site-packages/ldap/ldapobject.py", line 315, in _ldap_call
result = func(*args,**kwargs)
ldap.INSUFFICIENT_ACCESS: {'desc': 'Insufficient access'}
I'd like to have only the lines:
# ssh-ldap-pubkey add -H ldaps://<ldap-server>/ --quiet .ssh/id_ed25519.pub
Enter login (LDAP) password for user '<username>':
ldap.OBJECT_CLASS_VIOLATION: {'desc': 'Object class violation', 'info': "attribute 'sshPublicKey' not allowed"}
During handling of the above exception, another exception occurred:
ldap.INSUFFICIENT_ACCESS: {'desc': 'Insufficient access'}
here.
I'd suggest adding a new option -d --debug and printing the python traceback only when this option is supplied.
The text was updated successfully, but these errors were encountered:
protegh
changed the title
Supress tpython raceback in normal operation
Supress python traceback in normal operation
Oct 7, 2020
When e.g. calling
ssh-ldap-pubkey add
for an user that is still missing thesshPublicKey
attribute there naturally is an error message. But the ldap errors are covered by all the lines of the python traceback:I'd like to have only the lines:
here.
I'd suggest adding a new option
-d --debug
and printing the python traceback only when this option is supplied.The text was updated successfully, but these errors were encountered: