Closed larsl-net closed 1 year ago
Thank you for reporting this bug.
This is a copy paste error. To solve the problem it should be enough to delete MaintenanceType
from the import.
I will provide a bugfix tomorrow.
Yes, this problem is solved by removing the MaintenanceType
from the import.
Another problem is that I have 2fa enabled, which is solved by adding a new parameter api_2fa
and updating the login function with this token.
plugins/module_utils/common.py
common_module_args = dict(
api_url=dict(type="str", default="http://127.0.0.1:3001"),
api_username=dict(type="str"),
api_password=dict(type="str", no_log=True),
api_token=dict(type="str", no_log=True),
api_2fa=dict(type="str", default="", no_log=True)
)
plugins/modules/login.py
def run(api, params, result):
api_username = params["api_username"]
api_password = params["api_password"]
api_2fa = params["api_2fa"]
r = api.login(api_username, api_password, api_2fa)
result["token"] = r["token"]
Should I open an PR for that and have you a preference for the parameter name?
That would be great, thanks! I totally missed that I haven't implemented login with 2FA yet. The parameter name is fine.
When trying to use the maintenance module, I get the following error
After removing the try around the import statement in the module, I have got the following error:
ImportError: cannot import name 'MaintenanceType' from 'uptime_kuma_api'
Version: