Skip to content

Commit b14d405

Browse files
Enrico Usaienrico-usai
authored andcommitted
Print changes in the vpc_security_group_id when the update is allowed
Without this patch the update command wasn't displaying any change in the config when the update of the vpc_security_group_id parameter was allowed (not managed fsx). Invert test logic to verify all the expected changes are in the output and not viceversa. This logic was hiding the fact we were not printing the change in case of allowed update and was hiding a typo in the check result. Signed-off-by: Enrico Usai <[email protected]>
1 parent 118b57b commit b14d405

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cli/src/pcluster/config/update_policy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ def _check_unmanaged_fsx(_, patch):
285285
else "Remove the parameter '{0}'".format(change.param_key)
286286
),
287287
condition_checker=_check_unmanaged_fsx,
288-
# We don't want to show the change if allowed (e.g local value is empty)
289-
print_succeeded=False,
288+
print_succeeded=True,
290289
)
291290

292291
# Update effects are unknown.

cli/tests/pcluster/config/test_config_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def test_vpc_security_id_changes(
482482
Change("vpc", "default", "vpc_security_group_id", src_value, dst_value, UpdatePolicy.MANAGED_FSX),
483483
)
484484
if expected_patch_allowed:
485-
check = "SUCCEDED"
485+
check = "SUCCEEDED"
486486
reason = "-"
487487
action_needed = None
488488
else:
@@ -509,7 +509,7 @@ def test_vpc_security_id_changes(
509509
is_patch_allowed, rows = ConfigPatch(base_config=src_conf, target_config=dst_conf).check()
510510
assert_that(expected_patch_allowed).is_equal_to(is_patch_allowed)
511511

512-
for line in rows:
512+
for line in expected_message_rows:
513513
# Handle unicode string
514514
line = ["{0}".format(element) if isinstance(element, str) else element for element in line]
515-
assert_that(expected_message_rows).contains(line)
515+
assert_that(rows).contains(line)

0 commit comments

Comments
 (0)