You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
Trying to create two python_virtualenv resources within the same recipe throws an error on the creation of the second one, as the parent_python seems to include the path to the first one. The problem is that both virtualenvs are independent and shouldn't be referenced.
The recipe:
# UFC
git node['stic_correo']['ec']['local_ufc_path'] do
repository node['stic_correo']['ec']['remote_ufc_path']
user 'root'
group 'root'
action :sync
end
python_runtime '2'
python_virtualenv "#{node['stic_correo']['ec']['local_ufc_path']}/venv" do
user 'root'
group 'root'
action :create
not_if { ::File.directory?("#{node['stic_correo']['ec']['local_ufc_path']}/venv") }
end
pip_requirements "#{node['stic_correo']['ec']['local_ufc_path']}/requirements.txt" do
virtualenv "#{node['stic_correo']['ec']['local_ufc_path']}/venv"
end
# PCC
git node['stic_correo']['ec']['local_pcc_path'] do
repository node['stic_correo']['ec']['remote_pcc_path']
user 'root'
group 'root'
action :sync
end
python_virtualenv "#{node['stic_correo']['ec']['local_pcc_path']}/venv" do
user 'root'
group 'root'
action :create
not_if { ::File.directory?("#{node['stic_correo']['ec']['local_pcc_path']}/venv") }
end
pip_requirements "#{node['stic_correo']['ec']['local_pcc_path']}/requirements.txt" do
virtualenv "#{node['stic_correo']['ec']['local_pcc_path']}/venv"
end
These are two scripts (UFC and PCC). The creation of the first one's python_virtualenv resource goes smoothly, the second one's python_virtualenv throws this error:
* python_virtualenv[/opt/stic/pcc/venv] action create
================================================================================
Error executing action `create` on resource 'python_virtualenv[/opt/stic/pcc/venv]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] ----
STDOUT:
STDERR: /opt/stic/ufc/venv/bin/python: No module named virtualenv
---- End output of ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] ----
Ran ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] returned 1
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `tap'
/tmp/kitchen/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `language_command_shell_out!'
/tmp/kitchen/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:222:in `block in language_command_mixin'
/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_virtualenv.rb:157:in `create_virtualenv'
/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_virtualenv.rb:124:in `block in install_python'
/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_virtualenv.rb:123:in `install_python'
/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb:46:in `block in action_install'
/tmp/kitchen/cache/cookbooks/poise/files/halite_gem/poise/helpers/subcontext_block.rb:54:in `instance_eval'
/tmp/kitchen/cache/cookbooks/poise/files/halite_gem/poise/helpers/subcontext_block.rb:54:in `subcontext_block'
/tmp/kitchen/cache/cookbooks/poise/files/halite_gem/poise/helpers/notifying_block.rb:67:in `notifying_block'
/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb:45:in `action_install'
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/stic_correo/recipes/enviocorreo.rb
56: python_virtualenv "#{node['stic_correo']['ec']['local_pcc_path']}/venv" do
57: user 'root'
58: group 'root'
59: action :create
60: not_if { ::File.directory?("#{node['stic_correo']['ec']['local_pcc_path']}/venv") }
61: end
62:
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/stic_correo/recipes/enviocorreo.rb:56:in `from_file'
python_virtualenv("/opt/stic/pcc/venv") do
provider PoisePython::Resources::PythonVirtualenv::Provider
action [:create]
default_guard_interpreter :default
subresources [pip_requirements[/opt/stic/pcc/requirements.txt]]
declared_type :python_virtualenv
cookbook_name "stic_correo"
recipe_name "enviocorreo"
user "root"
group "root"
parent_python python_virtualenv[/opt/stic/ufc/venv]
path "/opt/stic/pcc/venv"
timeout 900
not_if { #code block }
end
System Info:
------------
chef_version=14.6.47
platform=centos
platform_version=7.3.1611
ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2018-11-08T14:20:22+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-11-08T14:20:22+00:00] ERROR: Exception handlers complete
Chef Client failed. 16 resources updated in 01 minutes 32 seconds
[2018-11-08T14:20:22+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-11-08T14:20:22+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-11-08T14:20:22+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: python_virtualenv[/opt/stic/pcc/venv] (stic_correo::enviocorreo line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] ----
STDOUT:
STDERR: /opt/stic/ufc/venv/bin/python: No module named virtualenv
---- End output of ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] ----
Ran ["/opt/stic/ufc/venv/bin/python", "-m", "virtualenv", "/opt/stic/pcc/venv"] returned 1
As you can see it includes parent_python python_virtualenv[/opt/stic/ufc/venv] which is the first virtualenv, although it doesn't have anything to do with it, the python executable (/opt/stic/ufc/venv/bin/python) is wrong as well.
Is this a bug? Any way to bypass this situation? I can't find anything in documentation regarding to parent_python.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Trying to create two
python_virtualenv
resources within the same recipe throws an error on the creation of the second one, as theparent_python
seems to include the path to the first one. The problem is that both virtualenvs are independent and shouldn't be referenced.The recipe:
These are two scripts (UFC and PCC). The creation of the first one's
python_virtualenv
resource goes smoothly, the second one'spython_virtualenv
throws this error:As you can see it includes
parent_python python_virtualenv[/opt/stic/ufc/venv]
which is the first virtualenv, although it doesn't have anything to do with it, the python executable (/opt/stic/ufc/venv/bin/python
) is wrong as well.Is this a bug? Any way to bypass this situation? I can't find anything in documentation regarding to
parent_python
.The text was updated successfully, but these errors were encountered: