Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
  • Loading branch information
sarunac and gmuloc authored Dec 13, 2024
1 parent f7bb504 commit 950fd1e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions anta/tests/cvx.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test(self) -> None:


class VerifyMcsServerMounts(AntaTest):
"""Verify if all MCS server mounts are in mountStateMountComplete.
"""Verify if all MCS server mounts are in a MountComplete state.
Expected Results
----------------
Expand Down Expand Up @@ -120,17 +120,17 @@ class Input(AntaTest.Input):
def validate_mount_states(self, mount: dict[str, Any], mcs_path_types: list[str]) -> None:
"""Validate the mount states of a given mount."""
mount_states = mount["mountStates"][0]
num_path_states = len(mount_states["pathStates"])
if num_path_states != len(mcs_path_types):

if (num_path_states := len(mount_states["pathStates"])) != len(mcs_path_types):
self.result.is_failure(f"Unexpected number of mount path states: {num_path_states}")

for path in mount_states["pathStates"]:
path_type = path["type"]
path_state = path["state"]
if path_type not in mcs_path_types:
self.result.is_failure(f"Unexpected MCS path type: {path_type}")
self.result.is_failure(f"Unexpected MCS path type: '{path_type}'".)
if path_state != "mountStateMountComplete":
self.result.is_failure(f"MCS server mount state is not valid: {path_state}")
self.result.is_failure(f"MCS server mount state for path '{path_type}' is not valid: '{path_state}'.")

@AntaTest.anta_test
def test(self) -> None:
Expand Down

0 comments on commit 950fd1e

Please sign in to comment.