Skip to content

Commit 01047ac

Browse files
author
Himani Anil Deshpande
committed
[SlurmTopo] Update the not_if guard for pcluster_topology_generator.py
* We do not update the file if queues are not updated and p6egb200_block_sizes does not exist
1 parent d5476c7 commit 01047ac

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
" --input-file #{node['cluster']['cluster_config_path']}"\
5252
"#{topology_generator_command_args}"\
5353
"#{topology_generator_extra_args}"
54-
not_if { ::File.exist?(node['cluster']['previous_cluster_config_path']) && topology_generator_command_args.nil? }
54+
not_if { topology_generator_command_args.nil? }
5555
end
5656
end
5757

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,18 @@ def self.update(chef_run)
129129
.with(mode: '0644')
130130
end
131131

132-
it 'update or cleanup topology.conf when block sizes are present' do
133-
expect(chef_run).to run_execute('update or cleanup topology.conf')
134-
.with(command: command_to_exe)
132+
if topo_command_args.nil?
133+
it 'update or cleanup topology.conf when block sizes are present' do
134+
expect(chef_run).not_to run_execute('update or cleanup topology.conf')
135+
.with(command: command_to_exe)
136+
end
137+
else
138+
it 'update or cleanup topology.conf when block sizes are present' do
139+
expect(chef_run).to run_execute('update or cleanup topology.conf')
140+
.with(command: command_to_exe)
141+
end
135142
end
143+
136144
end
137145
end
138146
end

0 commit comments

Comments
 (0)