Skip to content

Commit 62093fd

Browse files
fix: use where clause when querying SRs
Signed-off-by: Mathieu Labourier <[email protected]>
1 parent 0db97e8 commit 62093fd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sources/satellite_restart_and_controller_stop.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ def main(
149149
)
150150
atexit.register(session.xenapi.session.logout)
151151
hosts = set()
152-
for sr_ref in session.xenapi.SR.get_all():
153-
if session.xenapi.SR.get_type(sr_ref) != "linstor":
154-
continue
152+
for sr_ref in session.xenapi.SR.get_all_records_where('field "type" = "linstor"'):
155153
print(
156154
"SR: {} ({})".format(
157155
session.xenapi.SR.get_name_label(sr_ref),

0 commit comments

Comments
 (0)