mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Avoid calling maintenace or detach on destroy storage domain. (#28962)
As part of the absent state of ovirt_storage_domains module, the pre_remove method tries to move the stoage domain to maintenance and detach it. In case a destroy of a storage domain is being called there is no need for those operations since the destroy might be merely a DB operation.
This commit is contained in:
parent
d0d1c7d249
commit
0f39536c5c
1 changed files with 4 additions and 0 deletions
|
@ -383,6 +383,10 @@ class StorageDomainModule(BaseModule):
|
||||||
)
|
)
|
||||||
|
|
||||||
def pre_remove(self, storage_domain):
|
def pre_remove(self, storage_domain):
|
||||||
|
# In case the user chose to destroy the storage domain there is no need to
|
||||||
|
# move it to maintenance or detach it, it should simply be removed from the DB.
|
||||||
|
if self._module.params['destroy']:
|
||||||
|
return
|
||||||
# Before removing storage domain we need to put it into maintenance state:
|
# Before removing storage domain we need to put it into maintenance state:
|
||||||
self._maintenance(storage_domain)
|
self._maintenance(storage_domain)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue