Skip to content

Commit 8b4efdd

Browse files
Rexrexcsn
authored andcommitted
Update cluster_resource_bucket: address comments
Signed-off-by: Rex <[email protected]>
1 parent 8cd1e47 commit 8b4efdd

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

cli/pcluster/config/config_patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,12 @@ def check(self):
226226

227227
for change in self.changes:
228228
check_result, reason, action_needed, print_change = change.update_policy.check(change, self)
229+
230+
if check_result != UpdatePolicy.CheckResult.SUCCEEDED:
231+
patch_allowed = False
232+
229233
if print_change:
230234
section_name = get_file_section_name(change.section_key, change.section_label)
231-
232-
if check_result != UpdatePolicy.CheckResult.SUCCEEDED:
233-
patch_allowed = False
234235
rows.append(
235236
[
236237
section_name,

cli/pcluster/config/update_policy.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,12 @@ def _check_generated_bucket(change, patch):
141141

142142
# If bucket is generated (no cluster_resource_bucket specified when creating) and no change in config
143143
# Old value is retrieve from CFN's ResourcesS3Bucket param, and new value is from config(not specified)
144-
# Diff based on config should be:
145-
#
146-
# old value new value
147-
# ---------------------------------------------
148-
# {ResourcesS3Bucket} -
149-
#
150144
# Actual ResourcesS3Bucket will not change when updating, so no actual change when update is applied
151145
# Since there is no change, user should not be informed of a change/diff
152146
# Print no diff and proceed with updating other parameters
153-
if _is_bucket_pcluster_generated(patch.stack_name) and (not change.new_value or change.new_value == "NONE"):
154-
return True
155147
# Else display diff
156148
# Inform user cluster_resource_bucket/ResourcesS3Bucket will not be updated even if force update
157-
return False
149+
return _is_bucket_pcluster_generated(patch.stack_name) and not change.new_value
158150

159151

160152
# Base policies

0 commit comments

Comments
 (0)