diff --git a/cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster.sh.erb b/cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster.sh.erb index f9e2309c6..0f23d9c48 100644 --- a/cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster.sh.erb +++ b/cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster.sh.erb @@ -2,6 +2,7 @@ # pcluster.sh: # Setup ParallelCluster environment variables # -PATH=<%= @cfn_bootstrap_virtualenv_path %>/bin:$PATH + +PATH=$PATH:<%= @cfn_bootstrap_virtualenv_path %>/bin export PATH diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cfn_bootstrap_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cfn_bootstrap_spec.rb index 20a83960d..d48629c3d 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cfn_bootstrap_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cfn_bootstrap_spec.rb @@ -36,12 +36,6 @@ its('mode') { should cmp '0644' } its('owner') { should eq 'root' } its('group') { should eq 'root' } - its('content') { should match "PATH=#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin:\\$PATH" } + its('content') { should match "PATH=\\$PATH:#{pyenv_dir}/versions/#{cfn_python_version}/envs/cfn_bootstrap_virtualenv/bin" } 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