unificontrol
unificontrol copied to clipboard
create_radius_account leaving password blank
I'm trying to auto provision radius assigned vlan using MAC address. Calling create_radius_account with username and password being same results in blank password. Any suggestions?
@jondurrant Can you provide some details regarding your setup, and in particular what version of the Unifi controller you are running?
Sorry. Bit more detail on environment: Controller: atag_5.12.66_13102 (Raspberry PI hosted) Client: Python 3.9.1 being called from within Ansible Plugin. Ansible version 2.10.5
Snip of code line: self.controler.create_radius_account(cMac, cMac, 13, 6, vlan=vlanS)
Maybe is related with a typo that I've found trying to create radius accounts.
On controller logs:
<webapi-259> WARN sanitize - Invalid key exists in Account payload, key=x_passowrd
As the correct key is x_password.
On unifi.py file at line 53:
X_PASSWORD_FIX=fix_arg_names({"password":"x_passowrd"})
Changed to:
X_PASSWORD_FIX=fix_arg_names({"password":"x_password"})
And then it worked fine.