diff --git a/changelogs/fragments/57824-python-3-support-ovirt-dynamic-inv.yml b/changelogs/fragments/57824-python-3-support-ovirt-dynamic-inv.yml new file mode 100644 index 00000000000..3751a2c01e7 --- /dev/null +++ b/changelogs/fragments/57824-python-3-support-ovirt-dynamic-inv.yml @@ -0,0 +1,2 @@ +minor_changes: + - ovirt4 inventory - Updated the dynamic inventory script for Python 3 support diff --git a/contrib/inventory/ovirt4.py b/contrib/inventory/ovirt4.py index 69c3cc3a05f..74205ae449c 100755 --- a/contrib/inventory/ovirt4.py +++ b/contrib/inventory/ovirt4.py @@ -121,7 +121,7 @@ def create_connection(): 'ovirt_url': os.environ.get('OVIRT_URL'), 'ovirt_username': os.environ.get('OVIRT_USERNAME'), 'ovirt_password': os.environ.get('OVIRT_PASSWORD'), - 'ovirt_ca_file': os.environ.get('OVIRT_CAFILE'), + 'ovirt_ca_file': os.environ.get('OVIRT_CAFILE', ''), } ) if not config.has_section('ovirt'): @@ -133,8 +133,8 @@ def create_connection(): url=config.get('ovirt', 'ovirt_url'), username=config.get('ovirt', 'ovirt_username'), password=config.get('ovirt', 'ovirt_password', raw=True), - ca_file=config.get('ovirt', 'ovirt_ca_file'), - insecure=config.get('ovirt', 'ovirt_ca_file') is None, + ca_file=config.get('ovirt', 'ovirt_ca_file') or None, + insecure=not config.get('ovirt', 'ovirt_ca_file'), )