Skip to content

Commit

Permalink
Merge pull request #184 from DMTF/Fix180-Comparison-ConditionalRequir…
Browse files Browse the repository at this point in the history
…ements

Corrected ConditionalRequirements to test Comparison and Values inside of matching ConditionalRequirements
  • Loading branch information
mraineri authored Nov 3, 2023
2 parents 0d78687 + 25fc024 commit 545cab4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions redfish_interop_validator/interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def find_key_in_payload(path_to_key, redfish_parent_payload):
key_exists = False
return key_exists

def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple, item_name, chkCondition=False):
def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple, item_name):
"""
Validate PropertyRequirements
"""
Expand Down Expand Up @@ -486,7 +486,7 @@ def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple
if checkConditionalRequirement(propResourceObj, item, rf_payload_tuple):
my_logger.info("\tCondition DOES apply")
conditionalMsgs, conditionalCounts = validatePropertyRequirement(
propResourceObj, item, rf_payload_tuple, item_name, chkCondition=True)
propResourceObj, item, rf_payload_tuple, item_name)
counts.update(conditionalCounts)
for item in conditionalMsgs:
item.name = item.name.replace('.', '.Conditional.', 1)
Expand Down Expand Up @@ -541,9 +541,8 @@ def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple
if not success:
my_logger.error("MinSupportValues failed")

if "Values" in profile_entry and not chkCondition:
if "Values" in profile_entry:
# Default to AnyOf
# NOTE: chkCondition seems to skip this if a ConditionalRequirement is met, this may be unnecessary

my_compare = profile_entry.get("Comparison", "AnyOf")
msg, success = checkComparison(redfish_value, my_compare, profile_entry.get("Values", []))
Expand Down

0 comments on commit 545cab4

Please sign in to comment.