Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If used with, for example virtualenv 1.10.1, --reinitialize fails with OSError #5

Open
ke1g opened this issue Feb 4, 2015 · 0 comments

Comments

@ke1g
Copy link

ke1g commented Feb 4, 2015

virtualenv 1.10.1, at least the way we use it, creates the VE's bin directory with a python file and two symbolic links, python2 and python2.7, pointing to the python file. (Assuming one is using a 2.7 python.)

virtualenv-tools --reinitialize invokes virtualenv with -p /some/absolute/path/bin/python2.7

Amongst other fiddling, virtualenv copies the -p python to ve/bin/python2.7, apparently writing through the link, and replacing ve/bin/python. Then it decides to fix ve/bin/python and ve/bin/python2 by deleting them if they exist, and linking them to python2.7 (relative, so in ve/bin/). It starts with python, so now we have two symlinks pointing to one another. It then goes for python2, but since the target of that link doesn't exist as a file, os.path.exists says that ve/bin/python2 doesn't exist, so it skips unlinking it and goes right for the os.symlink call, which raises file exists, because there is something (the old link) at ve/bin/python2.

Granted, the virtualenv code is pretty weak, but it probably isn't maintained with the idea that it will be updating existing VEs. (Or if it is, that deserves a separate bug report.) But virtualenv-tools could be more defensive. One possibility is to hide (rename or move, for example) the existing ve/bin/python* files and links, discarding them if virtualenv successfully creates their replacements, and otherwise moving them back.

openstack-gerrit pushed a commit to openstack/openstack-ansible-os_gnocchi that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I8f6d4e1f8fc3010e333128d17eef1fc789ad5af5
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_rally that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I81d290d686582b23067e519285d27b9d4855c9e1
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_heat that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: Iba92168bfdec23218bcaf7fcdf460c8f2ed95d48
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_horizon that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: Id96a35e1c7c3bc200e7fa006352159d377823f4e
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_aodh that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: Id7a1d25732de7d6c9001a5ef3bcce7ae02da5350
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_sahara that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I4ed8cbfb69d1ade77fe545a701d0dd3a5e21e913
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ceilometer that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I101fe7082cac887dc4299a0f5ec92bdce626bb79
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ironic that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I87628ad30523e34bc3fa5abd454860d90663737f
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_nova that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I2f36bcf543647944b51dbf854d776dab98fee69c
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_magnum that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: Ieb97e0b245b870c0b5b42bf9b52e7400a65e38ad
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_tempest that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I2d4d7c042c565984f3ead21e68d16e23e4c286b6
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_swift that referenced this issue Nov 28, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I8f7d772d51c6407207cbc8d6a9eab30939eccfde
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_keystone that referenced this issue Nov 29, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I8a27bb268ea2e145ed113c652ab7846f6adc3f82
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_neutron that referenced this issue Nov 29, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I911f2a4de5b38d54bd7082fd2e8f2d66c2aa348a
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_glance that referenced this issue Nov 29, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I2377dc89e7220e653c0b9a3aab7e882cf2324f2e
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_cinder that referenced this issue Nov 29, 2016
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: Ic6c005bc55018898830bfc937829c6fade72e670
Related-Bug: #1637509
Partial-Bug: #1644629
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ceilometer that referenced this issue Aug 15, 2017
This is similar to I101fe7082cac887dc4299a0f5ec92bdce626bb79

openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I780960418ff9da7cac2f8716e88d2d8fb7bdb1c6
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_aodh that referenced this issue Aug 15, 2017
This is similar to Id7a1d25732de7d6c9001a5ef3bcce7ae02da5350
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I1cf438ad20758ea386db1df9cf683952c4215799
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_designate that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Idac8bc2e43d369876065d495ff42061f3619732c
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_gnocchi that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I242684d1f556927bd0967fff8cf8e692f7045a76
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_heat that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I628251e8729bd50035b13a11761872b23e001fc5
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_ironic that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I18d42e3ef0f6eca8e14128ad4fc8c3c8c46926e5
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_tempest that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Ib9b830bf607dbdf0d40583eec35789e10f5a7a49
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_nova that referenced this issue Aug 15, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I2cdd35843ee0d32a659a804c8a85b180c8db153e
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_keystone that referenced this issue Aug 16, 2017
This is similar to I8a27bb268ea2e145ed113c652ab7846f6adc3f82

openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I16ea455f8d9336237175e6c43f0b14713cf314d3
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_glance that referenced this issue Aug 16, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Iff9ddc29903a278dac7ab941fe7bd5bae1702bb7
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_horizon that referenced this issue Aug 16, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Ie3f4355eb53db563aaf5fa71d1ea9fb2ee5cfe32
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_cinder that referenced this issue Aug 17, 2017
This is similar to Ic6c005bc55018898830bfc937829c6fade72e670

openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Ib1b4313071c2442d1c320fb2eab5f4b072078960
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_swift that referenced this issue Aug 17, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I9011007d949ba4848c4e767b6cfab42e10eb1128
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_neutron that referenced this issue Aug 17, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I49beaf3f686adf02b156cb3d1d51ca7aebab6f6f
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_glance that referenced this issue Aug 19, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Iff9ddc29903a278dac7ab941fe7bd5bae1702bb7
(cherry picked from commit a6f93be)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_heat that referenced this issue Aug 19, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I628251e8729bd50035b13a11761872b23e001fc5
(cherry picked from commit bcb7019)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_horizon that referenced this issue Aug 19, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Ie3f4355eb53db563aaf5fa71d1ea9fb2ee5cfe32
(cherry picked from commit 91171e2)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_cinder that referenced this issue Aug 19, 2017
This is similar to Ic6c005bc55018898830bfc937829c6fade72e670

openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: Ib1b4313071c2442d1c320fb2eab5f4b072078960
(cherry picked from commit e1fd2e4)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_keystone that referenced this issue Aug 19, 2017
This is similar to I8a27bb268ea2e145ed113c652ab7846f6adc3f82

openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I16ea455f8d9336237175e6c43f0b14713cf314d3
(cherry picked from commit e4a2f0e)
openstack-gerrit pushed a commit to openstack/openstack-ansible-os_neutron that referenced this issue Aug 22, 2017
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I49beaf3f686adf02b156cb3d1d51ca7aebab6f6f
(cherry picked from commit 23b9b6a)
rayrobert398 added a commit to rayrobert398/swift-openstack-ansible-os_developer that referenced this issue Oct 3, 2022
please see fireteam/virtualenv-tools#5

This make installation of the virtualenv impossible on CentOS7 since
you endup with python > python2.7 and python2.7 > python

lrwxrwxrwx. 1 root root       9 Nov 24 20:49 python -> python2.7
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2 -> python
lrwxrwxrwx. 1 root root       6 Nov 14 20:03 python2.7 -> python

Change-Id: I8f7d772d51c6407207cbc8d6a9eab30939eccfde
Related-Bug: #1637509
Partial-Bug: #1644629
rayrobert398 added a commit to rayrobert398/swift-openstack-ansible-os_developer that referenced this issue Oct 3, 2022
openSUSE is also suffering from the same virtualenv-tools issue so
we need to remove the existing python-2.7 symlink.

Link: fireteam/virtualenv-tools#5
Related-Bug: #1637509
Partial-Bug: #1644629
Change-Id: I9011007d949ba4848c4e767b6cfab42e10eb1128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant