File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 6666
6767class DcsInstanceStatisticsInfoModule (OTCModule ):
6868 argument_spec = dict (
69- instance_id = dict (required = False )
69+ instance_id = dict (required = False ),
7070 )
7171 module_kwargs = dict (
7272 supports_check_mode = True
7373 )
7474
7575 def run (self ):
76- data = []
7776 final_data = []
7877
7978 for raw in self .conn .dcs .statistics ():
8079 dt = raw .to_dict ()
8180 dt .pop ('location' )
82- data .append (dt )
83-
84- i = 0
85- while i < len (data ):
8681 if self .params ['instance_id' ]:
87- if data [ i ][ ' instance_id' ] == self .params ['instance_id' ]:
88- final_data = data [ i ]
82+ if raw . instance_id == self .params ['instance_id' ]:
83+ final_data = dt
8984 break
9085 else :
91- final_data = data
92- break
93- i = i + 1
86+ final_data .append (dt )
9487
9588 self .exit (
9689 changed = False ,
You can’t perform that action at this time.
0 commit comments