Skip to content

Make sure req is defined in reset_password

Thomas Oulevey requested to merge toulevey/cern-get-keytab:master into master

Hi,

Small fix for a corner case in reset_password when missing CERN CAs :

Please review !

low priority.

local port 699 was not usable: HTTPSConnectionPool(host='lxkerbwin.cern.ch', port=443): Max retries exceeded with url: /api/ResetComputerPassword/host (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')))
Traceback (most recent call last):
  File "/home/debian/src/rpms/cern-get-keytab/src/cern-get-keytab.py", line 865, in <module>
    main()
  File "/home/debian/src/rpms/cern-get-keytab/src/cern-get-keytab.py", line 770, in main
    principal, password = reset_password(
                          ^^^^^^^^^^^^^^^
  File "/home/debian/src/rpms/cern-get-keytab/src/cern-get-keytab.py", line 391, in reset_password
    if not req:
           ^^^
UnboundLocalError: cannot access local variable 'req' where it is not associated with a value
Edited by Thomas Oulevey

Merge request reports