whitespace issue

This commit is contained in:
Matthew Wright
2026-02-19 16:33:40 -05:00
parent 7fa01f5fd5
commit f025886b31

View File

@@ -199,7 +199,7 @@ def replaceListObjectByCondition(content, key, conditionField, conditionValue, n
try:
if not isinstance(content[key], list):
raise AttributeError("Value is not a list")
# Find and replace the item that matches the condition
found = False
for i, item in enumerate(content[key]):
@@ -207,11 +207,11 @@ def replaceListObjectByCondition(content, key, conditionField, conditionValue, n
content[key][i] = newObject
found = True
break
if not found:
print(f"No list item found with {conditionField}={conditionValue}. No action was taken on the file.", file=sys.stderr)
return 1
except AttributeError:
print("The existing value for the given key is not a list. No action was taken on the file.", file=sys.stderr)
return 1
@@ -246,7 +246,7 @@ def replacelistobject(args):
content = loadYaml(filename)
result = replaceListObjectByCondition(content, key, conditionField, conditionValue, newObject)
if result != 1:
writeYaml(filename, content)