ovirt_network: correct when not specified external_provider (#66859)

This commit is contained in:
Martin Nečas 2020-01-28 17:08:46 +01:00 committed by ansibot
parent d385a648c4
commit b74ca2fe4f

View file

@ -171,8 +171,9 @@ from ansible.module_utils.ovirt import (
class NetworksModule(BaseModule): class NetworksModule(BaseModule):
def build_entity(self): def build_entity(self):
ons_service = self._connection.system_service().openstack_network_providers_service() if self.param('external_provider'):
on_service = ons_service.provider_service(get_id_by_name(ons_service, self.param('external_provider'))) ons_service = self._connection.system_service().openstack_network_providers_service()
on_service = ons_service.provider_service(get_id_by_name(ons_service, self.param('external_provider')))
return otypes.Network( return otypes.Network(
name=self._module.params['name'], name=self._module.params['name'],
comment=self._module.params['comment'], comment=self._module.params['comment'],