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):
|
||||
# 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:
|
||||
self._maintenance(storage_domain)
|
||||
|
||||
|
|
Loading…
Reference in a new issue