bash "install_project" do
cwd "/home/abc/apps/project"
user "abc"
code <<-EOH
sudo -u abc python ./install.py
EOH
only_if { ::File.exists?("/home/abc/apps/project") }
end
However it fails with a permission exception:
$ sudo -u abc -s bash -i -c "/usr/bin/python ./install.py"
Installing "project"...
Traceback (most recent call last):
File "./install.py", line 67, in <module>
shutil.copytree('template', dest)
File "/usr/lib/python2.7/shutil.py", line 177, in copytree
os.makedirs(dst)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/vagrant/.project'
How can I get the "python install.py" to run in the user 'abc' session?
Cheers, Tony
Archive powered by MHonArc 2.6.16.