Skip to content

Commit 32a68e9

Browse files
becitsthereGary Duan
authored andcommitted
NVSHAS-8216: check support script API return call
1 parent f033b0b commit 32a68e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/support

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def support(client, jointID, enforcers, output):
223223
path = "/v1/fed/cluster/{}{}".format(jointID, path)
224224
data = support_request(path, output)
225225
entries = data.get("hosts")
226-
if len(entries):
226+
if entries and len(entries):
227227
ids = [entry["id"] for entry in entries]
228228
for _, _path in enumerate(support_host[1:]):
229229
path = _path
@@ -238,7 +238,7 @@ def support(client, jointID, enforcers, output):
238238
path = "/v1/fed/cluster/{}{}".format(jointID, path)
239239
data = support_request(path, output)
240240
entries = data.get("controllers")
241-
if len(entries):
241+
if entries and len(entries):
242242
ids = [entry["id"] for entry in entries]
243243
for _, _path in enumerate(support_controller[1:]):
244244
path = _path
@@ -253,7 +253,7 @@ def support(client, jointID, enforcers, output):
253253
path = "/v1/fed/cluster/{}{}".format(jointID, path)
254254
data = support_request(path, output)
255255
entries = data.get("enforcers")
256-
if enforcers and len(entries) > 0:
256+
if enforcers and entries and len(entries) > 0:
257257
all = [entry["id"] for entry in entries]
258258
ids = []
259259

@@ -282,7 +282,7 @@ def support(client, jointID, enforcers, output):
282282
path = "/v1/fed/cluster/{}{}".format(jointID, path)
283283
data = support_request(path, output)
284284
entries = data.get("workloads")
285-
if len(entries):
285+
if entries and len(entries):
286286
ids = [entry["brief"]["id"] for entry in entries]
287287
for _, _path in enumerate(support_workload[1:]):
288288
path = _path

0 commit comments

Comments
 (0)