Bug 1491253 - [RFE] - /usr/share/ovirt-log-collector/analyzer/inventory-profile has hardcoded /tmp
Summary: [RFE] - /usr/share/ovirt-log-collector/analyzer/inventory-profile has hardcod...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-log-collector
Classification: oVirt
Component: General
Version: 4.1.4
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-4.2.2
: 4.2.3
Assignee: Douglas Schilling Landgraf
QA Contact: David Necpal
URL:
Whiteboard:
Depends On:
Blocks: 1456888
TreeView+ depends on / blocked
 
Reported: 2017-09-13 11:58 UTC by Jiri Belka
Modified: 2018-03-29 11:00 UTC (History)
4 users (show)

Fixed In Version: ovirt-log-collector-4.2.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-29 11:00:30 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.2?
dnecpal: testing_plan_complete-
rule-engine: planning_ack?
sbonazzo: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 85964 0 master MERGED inventory: do not use static /tmp in profile 2018-01-05 04:07:40 UTC
oVirt gerrit 86207 0 ovirt-log-collector-4.2 MERGED inventory: do not use static /tmp in profile 2018-01-11 02:46:02 UTC

Description Jiri Belka 2017-09-13 11:58:42 UTC
Description of problem:

analyzer should fully accept TMPDIR env var.

# grep mktemp /usr/bin/ovirt-log-collector-analyzer 
WORK_DIR="$(mktemp -d)"

this works fine and mktemp accepts TMPDIR env var.

but...

# grep -IR /tmp /usr/share/ovirt-log-collector/analyzer
/usr/share/ovirt-log-collector/analyzer/inventory-profile:HOSTS_SOSREPORT_EXTRACTED_DIR="/tmp/ovirt-log-collector-analyzer-hosts"

proposition:

# grep WORK_DIR /usr/share/ovirt-log-collector/analyzer/inventory-profile
HOSTS_SOSREPORT_EXTRACTED_DIR="${WORK_DIR}/ovirt-log-collector-analyzer-hosts"

# grep -n ^export /usr/bin/ovirt-log-collector-analyzer 
17:export WORK_DIR

Version-Release number of selected component (if applicable):
ovirt-log-collector-analyzer-4.1.5-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. run analyzer with TMP=foo env var
2.
3.

Actual results:
analyzer does not use only temporary dir defined but tries to use /tmp as it
is hardcoded

Expected results:
be smarter

Additional info:

Comment 1 Sandro Bonazzola 2018-01-31 10:23:30 UTC
Missed 4.2.1, moving to 4.2.2

Comment 2 David Necpal 2018-02-27 18:01:56 UTC
Verified on version ovirt-log-collector-analyzer-4.2.4-3.el7ev.noarch

-bash-4.2$ export TMPDIR="/tmp/test" && ovirt-log-collector-analyzer sosreport-LogCollector-20180227171353.tar.xz
Preparing environment:
======================
Temporary working directory is /tmp/test/tmp.boG91Qizvt
Unpacking postgres data. This can take up to several minutes.
sos-report extracted into: /tmp/test/tmp.boG91Qizvt/unpacked_sosreport
pgdump extracted into: /tmp/test/tmp.boG91Qizvt/pg_dump_dir
Welcome to unpackHostsSosReports script!
Extracting sosreport from hypervisor ...........

Creating a temporary database in /tmp/test/tmp.boG91Qizvt/postgresDb/pgdata. Log of initdb is in /tmp/test/tmp.boG91Qizvt/initdb.log

........

Importing the dump into a temporary database. Log of the restore process is in /tmp/test/tmp.boG91Qizvt/db-restore.log

Generating reports:
===================
Generated analyzer_report.html

Cleaning up:
============
Stopping temporary database
Removing temporary directory /tmp/test/tmp.boG91Qizvt

Comment 3 Sandro Bonazzola 2018-03-29 11:00:30 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.