File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
cookbooks/aws-parallelcluster-slurm/libraries Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -96,15 +96,15 @@ def to_s
9696# @return [Boolean] true if the change supports live updates; false, otherwise.
9797def storage_change_supports_live_update? ( changes )
9898 if changes . nil? || changes . empty?
99- Chef ::Log . info ( "No change found: assuming live update is supported" )
99+ Chef ::Log . info ( "No change found: live update is supported" )
100100 return true
101101 end
102102
103103 storage_changes = changes . select { |change | change [ "parameter" ] == "SharedStorage" }
104104
105105 if storage_changes . empty?
106- Chef ::Log . info ( "No shared storage change found: assuming live update is supported" )
107- return false
106+ Chef ::Log . info ( "No shared storage change found: live update is supported" )
107+ return true
108108 end
109109
110110 storage_changes . each do |change |
Original file line number Diff line number Diff line change @@ -113,14 +113,22 @@ def is_live_update_required?
113113
114114 Chef ::Log . info ( "Changeset found: evaluating changes #{ changes } " )
115115
116+ if changes . nil? || changes . empty?
117+ Chef ::Log . info ( "No change found in changeset: live update is not required" )
118+ return false
119+ end
120+
116121 outcome = case node [ "cluster" ] [ "node_type" ]
117122 when 'HeadNode'
118- # The head node supports live updates regardless the content of the changeset.
123+ # The head node supports live updates regardless the content of the changeset,
124+ # because we assume here that the CLI permitted only the submission of an update with changes
125+ # that can be handled by a live update on the head node.
119126 true
120127 when 'ComputeFleet' , 'LoginNode'
121128 # The compute and login nodes support live updates only in specific cases:
122- # * changeset contains only shared storage changes that support live updates
123- storage_change_supports_live_update? ( changes )
129+ # * changeset contains only shared storage changes that support live updates
130+ only_shared_storage_change = changes . all? { |change | change [ "parameter" ] == "SharedStorage" }
131+ only_shared_storage_change && storage_change_supports_live_update? ( changes )
124132 else
125133 raise "node_type must be HeadNode, LoginNode or ComputeFleet"
126134 end
You can’t perform that action at this time.
0 commit comments