Skip to content

Commit

Permalink
ovirt_disk: Fix issue in detaching the direct LUN
Browse files Browse the repository at this point in the history
The direct LUN doesn't have a disk profile and follow_link(self._connection, entity.disk_profile
) will be None. So detaching the LUN will fail with error "'NoneType' object has no attribute 'name'".

Signed-off-by: Nijin Ashok <nashok@redhat.com>
  • Loading branch information
nijinashok committed Apr 6, 2023
1 parent 41fec99 commit c0dbfca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/700-fix-directlun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ovirt_disk - Fix issue in detaching the direct LUN (https://github.com/oVirt/ovirt-ansible-collection/pull/700)
2 changes: 1 addition & 1 deletion plugins/modules/ovirt_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def update_check(self, entity):
equal(self.param('propagate_errors'), entity.propagate_errors) and
equal(otypes.ScsiGenericIO(self.param('scsi_passthrough')) if self.param('scsi_passthrough') else None, entity.sgio) and
equal(self.param('wipe_after_delete'), entity.wipe_after_delete) and
equal(self.param('profile'), follow_link(self._connection, entity.disk_profile).name)
equal(self.param('profile'), getattr(follow_link(self._connection, entity.disk_profile), 'name', None))
)


Expand Down

0 comments on commit c0dbfca

Please sign in to comment.