Skip to content

Commit d268ed8

Browse files
authored
Fix check_readiness return type and report count
1 parent f5e3389 commit d268ed8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

automation/check_readiness.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def check_hdfs(config: ArgoConfig, tenant_id: str, tenant_name: str) -> bool:
4242
return False
4343

4444

45-
def check_readiness(config: ArgoConfig, tenant_id: str, tenant_name: str) -> object:
45+
def check_readiness(config: ArgoConfig, tenant_id: str, tenant_name: str) -> bool:
4646
"""Checks tenants readiness by doing web-api requests to see if topology and
4747
reports are defined and also by checking if data are present both in ams and hdfs"""
4848

@@ -88,7 +88,8 @@ def check_readiness(config: ArgoConfig, tenant_id: str, tenant_name: str) -> obj
8888

8989
reports = web_api.get_reports(tenant_id, tenant_name, tenant_token)
9090

91-
if len(reports) < 0:
91+
if len(reports) <= 0:
92+
reports_ready = False
9293
reports_msg = "Tenant has no reports!"
9394

9495
# check metric data in hdfs
@@ -112,6 +113,4 @@ def check_readiness(config: ArgoConfig, tenant_id: str, tenant_name: str) -> obj
112113

113114
# update the payload to web-api
114115
result = web_api.update_ready_state(tenant_id, tenant_name, payload)
115-
if result:
116-
return True
117-
return False
116+
return True

0 commit comments

Comments
 (0)