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
Check that archives are not created within paths to be removed is unreliable #29420
Comments
From @ansibot on 2016-11-24T10:41:47Z @bendoh ping, this issue is waiting for your response. |
From @bendoh on 2016-11-24T10:41:47Z Cool, thanks for the report 👍 I'll look into it ASAP! |
From @gonzolino on 2016-11-24T10:41:47Z @bendoh Thanks, I already tried to fix it (see #3538), but it seems like there is a problem with the syntax, which is weird since it runs on my laptop... |
From @bendoh on 2016-11-24T10:41:47Z Yeah, that's a 2.5 syntax: http://stackoverflow.com/a/10314837/901644 |
From @bendoh on 2016-11-24T10:41:47Z Ansible python modules should be compatible with Python 2.3 to pass all checks |
From @gonzolino on 2016-11-24T10:41:47Z ok thanks, I did not know this. I will update my patch. |
has this been fixed yet? having the same probelm |
facing the same issue. Is there any workaround for time-being? I need the directory removed along with the files it contains after archiving. |
From @gonzolino on 2016-11-24T10:41:47Z
ISSUE TYPE
COMPONENT NAME
archive
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
When creating an archive with remove=True the archive module checks that the archive is not created within the paths to be removed.
Since the check is done with a simple
dest.startswith(path)
, it can happen that the check reports that the archive destination is in path whenpath
is a prefix ofdest
, but they are not on the same path. E.g.path=/tmp/test
anddest=/tmp/test.tar.gz
, heredest
is outside ofpath
, but the check would still report that the archive would be created in a path to be removed.STEPS TO REPRODUCE
The following playbook contains two tasks. The first will work because
path
is not a prefix ofdest
, the second will fail becausepath
is a prefix ofdest
.EXPECTED RESULTS
ACTUAL RESULTS
Copied from original issue: ansible/ansible-modules-extras#3537
The text was updated successfully, but these errors were encountered: