Hello all
I just recently installed a fresh oVirt appliance. Now I want to use the API to perform
some actions but fail to provide the correct username. Can you help?
Here's my script:
import ovirtsdk4 as sdk
from getpass import getpass
dc_name = "Default"
clu_name = "Default"
connection = sdk.Connection(
url="https://ovirt-engine-test.admin.int.rabe.ch/ovirt-engine/api",
username="admin@ovirt",
password=getpass(),
# ca_file="/etc/pki/ovirt-engine/ca.pem",
insecure=True,
)
...
That's the error I get:
Traceback (most recent call last):
File "/home/user/ovirt_iso_script/./setup_networks.py", line 25, in
<module>
dc = next(d for d in dcs_svc.list() if d.name == dc_name)
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/services.py", line 6863,
in list
return self._internal_get(headers, query, wait)
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/service.py", line 202, in
_internal_get
context = self._connection.send(request)
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/__init__.py", line 371, in
send
return self.__send(request)
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/__init__.py", line 389, in
__send
self.authenticate()
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/__init__.py", line 382, in
authenticate
self._sso_token = self._get_access_token()
File "/usr/lib64/python3.10/site-packages/ovirtsdk4/__init__.py", line 624, in
_get_access_token
raise AuthError(
ovirtsdk4.AuthError: Error during SSO authentication access_denied : Cannot authenticate
user No valid profile found in credentials..