-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ovirt_vm: fix cd_iso get all disks from storage domains #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Eyal, could you please also take a look? |
@mnecas Thanks for the patch.
|
yeah currently this is work in progress |
@n0p90 could you please try it on 4.3? |
@mnecas
Here is a patch to make it work on oVirt 4.3, I'll let you check if it also works on oVirt 4.4: diff --git a/plugins/modules/ovirt_vm.py b/plugins/modules/ovirt_vm.py
index 23a939b..8bcee47 100644
--- a/plugins/modules/ovirt_vm.py
+++ b/plugins/modules/ovirt_vm.py
@@ -1662,10 +1662,17 @@ class VmsModule(BaseModule):
def __get_cds_from_sds(self, sds):
for sd in sds:
- if sd.disks is None:
+ if sd.type == otypes.StorageDomainType.ISO:
+ disks = sd.files
+ is_iso = lambda x: True
+ elif sd.type == otypes.StorageDomainType.DATA:
+ disks = sd.disks
+ is_iso = lambda x: x.content_type == otypes.DiskContentType.ISO
+ else:
+ # is there any other storage type from which ISO can be loaded?
continue
- disks = list(filter(lambda x: (x.name == self.param('cd_iso') or x.id == self.param('cd_iso')) and x.content_type == otypes.DiskContentType.ISO,
- self._connection.follow_link(sd.disks)))
+ disks = list(filter(lambda x: (x.name == self.param('cd_iso') or x.id == self.param('cd_iso')) and is_iso(x),
+ self._connection.follow_link(disks)))
if disks:
return disks
I've never used the Thanks! |
Done some investigation and turned up that my env was broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Fixes: #62
Issue: in 4.3 the disks from ISO storage domain were not able to get from disks_service to make it backward compatible did need to gather all storage domains
@mwperina @dangel101