Skip to content

Commit a31a403

Browse files
authored
Iterate over lsdrive output to get detail information from the drive
1 parent e346069 commit a31a403

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugins/modules/ibm_svc_info.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@
618618
from ansible_collections.ibm.spectrum_virtualize.plugins.module_utils.ibm_svc_utils import IBMSVCRestApi, svc_argument_spec, get_logger
619619
from ansible.module_utils._text import to_native
620620

621+
import time
622+
621623

622624
class IBMSVCGatherInfo(object):
623625
def __init__(self):
@@ -739,6 +741,15 @@ def get_list(self, subset, op_key, cmd, validate):
739741
output[op_key] = self.restapi.svc_obj_info(cmd=cmd,
740742
cmdopts=None,
741743
cmdargs=cmdargs)
744+
if cmd == "lsdrive":
745+
drive = []
746+
for d in output[op_key]:
747+
self.log.info("log iteration %s", d["id"])
748+
cmdargs = [d["id"]]
749+
time.sleep(0.08)
750+
d.update(self.restapi.svc_obj_info(cmd=cmd,
751+
cmdopts=None,
752+
cmdargs=cmdargs))
742753
self.log.info('Successfully listed %d %s info '
743754
'from cluster %s', len(subset), subset,
744755
self.module.params['clustername'])

0 commit comments

Comments
 (0)