The engine-log-collector command option --local-tmp has been updated. When using this option to point to a temporary directory, ensure the directory is empty before running the log collector. If the local temporary directory pointed by the --local-tmp option is not empty, the command will exit with an error.
Description of problem:
When we are running engine-log-collector with option --local-tmp which is used for storing temporary reports gathered from hypervisors, the directory used --local-tmp is deleted with all data currently present in it.
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Make a directory, add some test files in directory
e.g. mkdir /test; touch /test/file{1..10}.txt
2. Use above created directory while running engine-log-collector in option --local-tmp
e.g. engine-log-collector --local-tmp=/test collect
3. After successful execution of command now /test directory is deleted
Actual results:
Directory is completely deleted
Expected results:
Only files gathered from hypervisor should be deleted
Additional info:
If we are using --local-tmp=/test/tmp then only tmp directory with all of its content is deleted.
If this behavior is intentional, than the -h output should be more clear. Currently, it states as follows:
--local-tmp=PATH directory to copy reports to locally. Please note that
the local-tmp directory is used only for storing
temporary reports gathered from hypervisors.(default
is randomly generated like: /tmp/logcollector-PelSIq)
If this directory will always be deleted, it should be clearly stated here that the directory will be removed upon completion, and that the directory should be empty.
Comment 3Yedidyah Bar David
2016-01-20 08:20:38 UTC
I think we should keep existing behavior, and:
1. Fix --help
2. Require the directory to be empty and abort otherwise
Verified with:
rhevm-log-collector-3.6.1-1.el6ev.noarch
# engine-log-collector collect --local-tmp=./tmp
This command will collect system configuration and diagnostic
information from this system.
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before
being passed to any third party.
No changes will be made to system configuration.
ERROR: ./tmp directory is not empty.
Use the -h option to see usage.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHEA-2016-0392.html
Description of problem: When we are running engine-log-collector with option --local-tmp which is used for storing temporary reports gathered from hypervisors, the directory used --local-tmp is deleted with all data currently present in it. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Make a directory, add some test files in directory e.g. mkdir /test; touch /test/file{1..10}.txt 2. Use above created directory while running engine-log-collector in option --local-tmp e.g. engine-log-collector --local-tmp=/test collect 3. After successful execution of command now /test directory is deleted Actual results: Directory is completely deleted Expected results: Only files gathered from hypervisor should be deleted Additional info: If we are using --local-tmp=/test/tmp then only tmp directory with all of its content is deleted.