Skip to content

Commit

Permalink
ovirt_disk: dont move disk when already in storage_domain (#135)
Browse files Browse the repository at this point in the history
* ovirt_disk: dont move disk when already in storage_domain

* add fragment
  • Loading branch information
mnecas authored Oct 6, 2020
1 parent ec98950 commit 2bc5a34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/ovirt_disk-fix-move.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ovirt_disk - dont move disk when already in storage_domain (https://github.com/oVirt/ovirt-ansible-collection/pull/135)
2 changes: 2 additions & 0 deletions plugins/modules/ovirt_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ def update_storage_domains(self, disk_id):
# Initiate move:
if self._module.params['storage_domain']:
new_disk_storage_id = get_id_by_name(sds_service, self._module.params['storage_domain'])
if new_disk_storage_id in [sd.id for sd in disk.storage_domains]:
return changed
changed = self.action(
action='move',
entity=disk,
Expand Down

0 comments on commit 2bc5a34

Please sign in to comment.