set-turris-auth fails when only foris-auth is in uci and not turris-auth
Previously, we used foris.auth.password, but with turris-auth, it's called turris-auth.admin.password
. There is backwards compatibility when reading the password, but not when writing it, so uci.set() in password.py fails when the key doesn't exist.
tested on Turris OS 6.0 with turris-auth 0.3.1
root@turris:~# set-turris-auth
New password (input not printed!):
New password again:
Traceback (most recent call last):
File "/usr/bin/set-turris-auth", line 33, in <module>
sys.exit(load_entry_point('turris-auth==0.4.0', 'console_scripts', 'set-turris-auth')())
File "/usr/lib/python3.9/site-packages/turris_auth/__main__.py", line 29, in main
File "/usr/lib/python3.9/site-packages/turris_auth/password.py", line 13, in assign
File "/usr/lib/python3.9/site-packages/euci/__init__.py", line 140, in set
uci.UciException: Invalid argument
Edited by Michal Vasilek