Skip to content

Commit d086657

Browse files
himani2411Himani Deshpande
andauthored
Changing the PATH order we set for using the cfnbootstrap script we have installed in virtualenv rather than using default scripts (#2729)
* Adding Kitchen test to verify the PATH used for cfn-init is the one we have installed using virtualenv Co-authored-by: Himani Deshpande <[email protected]>
1 parent 82683e1 commit d086657

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster.sh.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# pcluster.sh:
33
# Setup ParallelCluster environment variables
44
#
5-
6-
PATH=$PATH:<%= @cfn_bootstrap_virtualenv_path %>/bin
5+
PATH=<%= @cfn_bootstrap_virtualenv_path %>/bin:$PATH
76

87
export PATH

cookbooks/aws-parallelcluster-environment/test/controls/cfn_bootstrap_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
its('mode') { should cmp '0644' }
3737
its('owner') { should eq 'root' }
3838
its('group') { should eq 'root' }
39-
its('content') { should match "PATH=\\$PATH:#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin" }
39+
its('content') { should match "PATH=#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin:\\$PATH" }
4040
end
41+
42+
desc "cfn-init needs to be from the cfnbootstrap virtualenv"
43+
describe bash("sudo -u #{node['cluster']['cluster_user']} -i which cfn-init") do
44+
its('exit_status') { should eq(0) }
45+
its('stdout') { should match("#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin/cfn-init") }
46+
end unless os_properties.on_docker?
4147
end

0 commit comments

Comments
 (0)