Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1175196

Summary: "parse-environment" and "parse-environment-list" fail to parse "LIBGUESTFS_TRACE = 0"
Product: Red Hat Enterprise Linux 7 Reporter: Chao Zhang <chazhang>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.1CC: huzhan, leiwang, mbooth, ptoscano, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.28.1-1.25.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:58:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chao Zhang 2014-12-17 10:12:51 UTC
Description of problem:
"parse-environment" and "parse-environment-list" fail to parse "LIBGUESTFS_TRACE = 0"

Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.28.1-1.17.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.add an image, mount the root filesystem
# guestfish -N fs
><fs> mount /dev/sda1 /

2. parse $LIBGUESTFS_TRACE to "1"
><fs> !echo $LIBGUESTFS_TRACE
0
><fs> ls /
lost+found
><fs> setenv LIBGUESTFS_TRACE 1
><fs> ls /
lost+found
><fs> !echo $LIBGUESTFS_TRACE
1
><fs> parse-environment
><fs> ls /
libguestfs: trace: ls "/"
libguestfs: trace: ls0 "/" "/tmp/libguestfs0vHOeV/ls4"
libguestfs: trace: ls0 = 0
libguestfs: trace: ls = ["lost+found"]
lost+found

3. Try to parse $LIBGUESTFS_TRACE back to "0"
><fs> setenv LIBGUESTFS_TRACE 0
><fs> !echo $LIBGUESTFS_TRACE
0
><fs> parse-environment
libguestfs: trace: parse_environment
libguestfs: trace: parse_environment = 0
><fs> ls /
libguestfs: trace: ls "/"
libguestfs: trace: ls0 "/" "/tmp/libguestfs0vHOeV/ls5"
libguestfs: trace: ls0 = 0
libguestfs: trace: ls = ["lost+found"]
lost+found
><fs> parse-environment-list "LIBGUESTFS_TRACE=0"
libguestfs: trace: parse_environment_list "LIBGUESTFS_TRACE=0"
libguestfs: trace: parse_environment_list = 0
><fs> ls /
libguestfs: trace: ls "/"
libguestfs: trace: ls0 "/" "/tmp/libguestfs0vHOeV/ls9"
libguestfs: trace: ls0 = 0
libguestfs: trace: ls = ["lost+found"]
lost+found

Actual results:
as described above

Expected results:
The trace info should not be printed out.


Additional info:

Comment 1 Richard W.M. Jones 2014-12-17 13:13:54 UTC
This is not really a bug, more of an RFE.

Reproducer:

guestfish setenv LIBGUESTFS_TRACE 1 : parse-environment : get-trace : setenv LIBGUESTFS_TRACE 0 : parse-environment : get-trace

(all on one line)

Before the change, it will print:

true
true

After the change, it will print:

true
false

Comment 2 Richard W.M. Jones 2014-12-17 14:05:15 UTC
Patches posted:

https://www.redhat.com/archives/libguestfs/2014-December/thread.html#00167

Comment 3 Richard W.M. Jones 2014-12-18 08:24:52 UTC
Upstream commits:

bdcd2fabe9a5ba6f61e662986fcd92e352f203c0
5f6677ebd0fd6f6712de808ca27eab4468f966bc
f1ecd6af808f22af913a589754ae11dc1e35b658

Comment 7 Hu Zhang 2015-05-06 07:18:07 UTC
Verified with libguestfs-1.28.1-1.29.el7.

Step to verify:
1. # guestfish setenv LIBGUESTFS_TRACE 1 : parse-environment : get-trace : setenv LIBGUESTFS_TRACE 0 : parse-environment : get-trace
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
true
libguestfs: trace: parse_environment
libguestfs: trace: set_trace false
libguestfs: trace: set_trace = 0
libguestfs: trace: parse_environment = 0
false

2. # guestfish set-trace 1 : get-trace : parse-environment-list "LIBGUESTFS_TRACE=0" : get-trace : parse-environment-list "LIBGUESTFS_TRACE=1" : get-trace
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
true
libguestfs: trace: parse_environment_list "LIBGUESTFS_TRACE=0"
libguestfs: trace: set_trace false
libguestfs: trace: set_trace = 0
libguestfs: trace: parse_environment_list = 0
false
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
true
libguestfs: trace: shutdown
libguestfs: trace: shutdown = 0
libguestfs: trace: close

So "parse-environment" and "parse-environment-list" work as excepted. So fixed.

Comment 9 errata-xmlrpc 2015-11-19 06:58:26 UTC
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/RHBA-2015-2183.html