Skip to content

Commit

Permalink
Changing the PATH order we set for using the cfnbootstrap script we h…
Browse files Browse the repository at this point in the history
…ave installed in virtualenv rather than using default scripts (#2730)

* 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]>
  • Loading branch information
himani2411 and Himani Deshpande authored May 22, 2024
1 parent 4dfa1f7 commit 26a3c9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# pcluster.sh:
# Setup ParallelCluster environment variables
#

PATH=$PATH:<%= @cfn_bootstrap_virtualenv_path %>/bin
PATH=<%= @cfn_bootstrap_virtualenv_path %>/bin:$PATH

export PATH
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
its('mode') { should cmp '0644' }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('content') { should match "PATH=\\$PATH:#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin" }
its('content') { should match "PATH=#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin:\\$PATH" }
end

desc "cfn-init needs to be from the cfnbootstrap virtualenv"
describe bash("sudo -u #{node['cluster']['cluster_user']} -i which cfn-init") do
its('exit_status') { should eq(0) }
its('stdout') { should match("#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin/cfn-init") }
end unless os_properties.on_docker?
end

0 comments on commit 26a3c9d

Please sign in to comment.