Skip to content

Commit d9c1f84

Browse files
committed
[DFSM] Address linter failures.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent c33984a commit d9c1f84

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

cookbooks/aws-parallelcluster-slurm/libraries/dynamo.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
# the instance id and the cluster config version deployed on that instance.
1616
# This is done to understand what is the deployed cluster config in each node, for example, during a CFN Stack update.
1717

18-
1918
DDB_CONFIG_STATUS = {
2019
DEPLOYED: "DEPLOYED",
21-
SKIPPED_LIVE_UPDATE: "SKIPPED_LIVE_UPDATE"
22-
}
20+
SKIPPED_LIVE_UPDATE: "SKIPPED_LIVE_UPDATE",
21+
}.freeze
2322

2423
def save_instance_config_version_to_dynamodb(status)
2524
unless on_docker? || kitchen_test? && !node['interact_with_ddb']

cookbooks/aws-parallelcluster-slurm/libraries/update.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ def is_live_update_required?
114114
Chef::Log.info("Changeset found: evaluating changes #{changes}")
115115

116116
outcome = case node["cluster"]["node_type"]
117-
when 'HeadNode'
118-
# The head node supports live updates regardless the content of the changeset.
119-
true
120-
when 'ComputeFleet','LoginNode'
121-
# 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)
124-
else
125-
raise "node_type must be HeadNode, LoginNode or ComputeFleet"
126-
end
117+
when 'HeadNode'
118+
# The head node supports live updates regardless the content of the changeset.
119+
true
120+
when 'ComputeFleet', 'LoginNode'
121+
# 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)
124+
else
125+
raise "node_type must be HeadNode, LoginNode or ComputeFleet"
126+
end
127127

128128
Chef::Log.info("Live update required: #{outcome}")
129129
end

cookbooks/aws-parallelcluster-slurm/recipes/update/update_compute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
unless lambda { is_live_update_required? }.call
18+
unless -> { is_live_update_required? }.call
1919
save_instance_config_version_to_dynamodb(DDB_CONFIG_STATUS[:SKIPPED_LIVE_UPDATE])
2020
return
2121
end

cookbooks/aws-parallelcluster-slurm/recipes/update/update_login_node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
unless lambda { is_live_update_required? }.call
18+
unless -> { is_live_update_required? }.call
1919
save_instance_config_version_to_dynamodb(DDB_CONFIG_STATUS[:SKIPPED_LIVE_UPDATE])
2020
return
2121
end

0 commit comments

Comments
 (0)