Skip to content

Commit

Permalink
Merge pull request #24863 from redpanda-data/rpdevmp/DEVPROD-2566
Browse files Browse the repository at this point in the history
Adding error handling for get nodes or instances
  • Loading branch information
rpdevmp authored Jan 24, 2025
2 parents 6651515 + 50cfed5 commit bfe7a51
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/rptest/redpanda_cloud_tests/config_profile_verify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ def _check_aws_nodes(self):
'--query="Reservations[0].Instances[*].InstanceType"'
]
res = subprocess.check_output(cmd)
resd = json.loads(res)
try:
resd = json.loads(res)
except json.JSONDecodeError as e:
self.logger.error(
f"Failed to parse AWS describe-instances response: {res}")
raise ValueError(
f"Failed to parse AWS describe-instances response: {e}")

self.logger.debug(
"asserting nodes_count: expected: {}, actual: {}".format(
Expand All @@ -107,6 +113,13 @@ def _check_azure_nodes(self):
output = subprocess.check_output(cmd)
self.logger.debug(f'nodes: {output}')
nodes = json.loads(output)
try:
nodes = json.loads(nodes)
except json.JSONDecodeError as e:
self.logger.error(
f"Failed to parse kubectl get nodes response: {nodes}")
raise ValueError(
f"Failed to parse kubectl get nodes response: {e}")

config_nodes_count = self._configProfile['nodes_count']
actual_nodes_count = len(nodes)
Expand All @@ -123,7 +136,13 @@ def _check_gcp_nodes(self):
self._clusterId), '--format="json(name,machineType,disks)"'
]
res = subprocess.check_output(cmd)
resd = json.loads(res)
try:
resd = json.loads(res)
except json.JSONDecodeError as e:
self.logger.error(
f"Failed to parse gcloud compute instances response: {res}")
raise ValueError(
f"Failed to parse gcloud compute instances response: {e}")

self.logger.debug(
"asserting machineType: expected: {}, actual: {}".format(
Expand Down

0 comments on commit bfe7a51

Please sign in to comment.