Skip to content

Commit e8a8c18

Browse files
author
Himani Anil Deshpande
committed
[SlurmTopo] cookstyle
1 parent 01047ac commit e8a8c18

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

cookbooks/aws-parallelcluster-slurm/attributes/slurm_attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
default['cluster']['pyxis']['runtime_path'] = '/run/pyxis'
2828

2929
# Block Topology Plugin
30-
default['cluster']['slurm']['block_topology']['force_configuration'] = false
30+
default['cluster']['slurm']['block_topology']['force_configuration'] = false

cookbooks/aws-parallelcluster-slurm/resources/block_topology/partial/_block_topology_common.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,5 @@ def topology_generator_command_args
7474
def topology_generator_extra_args
7575
if ['true', 'yes', true].include?(node['cluster']['slurm']['block_topology']['force_configuration'])
7676
" --force-configuration"
77-
else
78-
nil
7977
end
80-
end
78+
end

cookbooks/aws-parallelcluster-slurm/spec/unit/resources/block_topology_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ def self.update(chef_run)
6161
.with(group: 'root')
6262
.with(mode: '0644')
6363
end
64-
command = "#{cookbook_env}/bin/python #{script_dir}/slurm/pcluster_topology_generator.py" \
64+
command = "#{cookbook_env}/bin/python #{script_dir}/slurm/pcluster_topology_generator.py" \
6565
" --output-file #{slurm_install_dir}/etc/topology.conf" \
6666
" --block-sizes #{block_sizes}" \
6767
" --input-file #{cluster_config}"
68-
if ['true', 'yes', true].include?(force_configuration)
69-
command_to_exe = "#{command}#{force_configuration_extra_args}"
70-
else
71-
command_to_exe = "#{command}"
72-
end
68+
command_to_exe = if ['true', 'yes', true].include?(force_configuration)
69+
"#{command}#{force_configuration_extra_args}"
70+
else
71+
"#{command}"
72+
end
7373
it 'generates topology config when block sizes are present' do
7474
expect(chef_run).to run_execute('generate_topology_config')
7575
.with(command: command_to_exe)
@@ -115,11 +115,11 @@ def self.update(chef_run)
115115
" --output-file #{slurm_install_dir}/etc/topology.conf" \
116116
" --input-file #{cluster_config}"\
117117
"#{topo_command_args}"
118-
if ['true', 'yes', true].include?(force_configuration)
119-
command_to_exe = "#{command}#{force_configuration_extra_args}"
120-
else
121-
command_to_exe = "#{command}"
122-
end
118+
command_to_exe = if ['true', 'yes', true].include?(force_configuration)
119+
"#{command}#{force_configuration_extra_args}"
120+
else
121+
"#{command}"
122+
end
123123

124124
it 'creates the topology configuration template' do
125125
expect(chef_run).to create_template("#{slurm_install_dir}/etc/slurm_parallelcluster_topology.conf")
@@ -132,12 +132,12 @@ def self.update(chef_run)
132132
if topo_command_args.nil?
133133
it 'update or cleanup topology.conf when block sizes are present' do
134134
expect(chef_run).not_to run_execute('update or cleanup topology.conf')
135-
.with(command: command_to_exe)
135+
.with(command: command_to_exe)
136136
end
137137
else
138138
it 'update or cleanup topology.conf when block sizes are present' do
139139
expect(chef_run).to run_execute('update or cleanup topology.conf')
140-
.with(command: command_to_exe)
140+
.with(command: command_to_exe)
141141
end
142142
end
143143

0 commit comments

Comments
 (0)