|
|
@ -34,6 +34,7 @@ from ansible.module_utils.ovirt import (
|
|
|
|
check_sdk,
|
|
|
|
check_sdk,
|
|
|
|
create_connection,
|
|
|
|
create_connection,
|
|
|
|
equal,
|
|
|
|
equal,
|
|
|
|
|
|
|
|
get_entity,
|
|
|
|
ovirt_full_argument_spec,
|
|
|
|
ovirt_full_argument_spec,
|
|
|
|
search_by_name,
|
|
|
|
search_by_name,
|
|
|
|
wait,
|
|
|
|
wait,
|
|
|
@ -285,7 +286,7 @@ class StorageDomainModule(BaseModule):
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
attached_sd_service = attached_sds_service.storage_domain_service(storage_domain.id)
|
|
|
|
attached_sd_service = attached_sds_service.storage_domain_service(storage_domain.id)
|
|
|
|
attached_sd = attached_sd_service.get()
|
|
|
|
attached_sd = get_entity(attached_sd_service)
|
|
|
|
|
|
|
|
|
|
|
|
if attached_sd and attached_sd.status != sdstate.MAINTENANCE:
|
|
|
|
if attached_sd and attached_sd.status != sdstate.MAINTENANCE:
|
|
|
|
if not self._module.check_mode:
|
|
|
|
if not self._module.check_mode:
|
|
|
@ -305,7 +306,7 @@ class StorageDomainModule(BaseModule):
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
attached_sd_service = attached_sds_service.storage_domain_service(storage_domain.id)
|
|
|
|
attached_sd_service = attached_sds_service.storage_domain_service(storage_domain.id)
|
|
|
|
attached_sd = attached_sd_service.get()
|
|
|
|
attached_sd = get_entity(attached_sd_service)
|
|
|
|
|
|
|
|
|
|
|
|
if attached_sd and attached_sd.status == sdstate.MAINTENANCE:
|
|
|
|
if attached_sd and attached_sd.status == sdstate.MAINTENANCE:
|
|
|
|
if not self._module.check_mode:
|
|
|
|
if not self._module.check_mode:
|
|
|
@ -333,7 +334,7 @@ class StorageDomainModule(BaseModule):
|
|
|
|
|
|
|
|
|
|
|
|
# If storage domain isn't attached, attach it:
|
|
|
|
# If storage domain isn't attached, attach it:
|
|
|
|
attached_sd_service = self._service.service(storage_domain.id)
|
|
|
|
attached_sd_service = self._service.service(storage_domain.id)
|
|
|
|
if attached_sd_service.get() is None:
|
|
|
|
if get_entity(attached_sd_service) is None:
|
|
|
|
self._service.add(
|
|
|
|
self._service.add(
|
|
|
|
otypes.StorageDomain(
|
|
|
|
otypes.StorageDomain(
|
|
|
|
id=storage_domain.id,
|
|
|
|
id=storage_domain.id,
|
|
|
|