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 1073072

Summary: v1.0.0 Inifile lense is limited in functionality
Product: Red Hat Enterprise Linux 6 Reporter: Greg Swift <gregswift>
Component: augeasAssignee: Dominic Cleal <dcleal>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5CC: huzhan, leiwang, lkong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: augeas-1.0.0-6.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:15:44 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 Greg Swift 2014-03-05 17:24:32 UTC
Description of problem:
Tryign to work with several ini formatted files.  The IniFile lense in v1.0.0 does not include its own generic lens.  Several lenses utilize it.  However, I have tried several of these and none of them have worked with my files. The lens that is in v1.1 works for these files on a Fedora based system.

Version-Release number of selected component (if applicable):
1.0.0-5.el6_5.1

How reproducible:
very

Steps to Reproduce:
1. augtool -t 'Puppet.lns incl /path/to/ini'
2. print /files/path/to/ini
3. print /augeas/files/path/to/ini/error

Actual results:
If the file is parseable the print /files/ will display a list of the key value pairs.  However for mine it shows nothing.

If the file is not parseable the print /augeas/files/../error will display information about the parsing failure.  For the several lenses I tried I get the same error:

  augtool> print /augeas/files/etc/blah/blah.properties/error
  /augeas/files/etc/blah/blah.properties/error = "parse_failed"
  /augeas/files/etc/blah/blah.properties/error/pos = "306"
  /augeas/files/etc/blah/blah.properties/error/line = "8"
  /augeas/files/etc/blah/blah.properties/error/char = "0"
  /augeas/files/etc/blah/blah.properties/error/lens = "/usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:"
  /augeas/files/etc/blah/blah.properties/error/message = "Get did not match entire input"

The line it is erroring on is this:

  database.migration.cleanOnStartup=false


Expected results:
augtool> print /files/blah/blah.properties/
  /files/blah/blah.properties
  /files/blah/blah.properties/section = ".anon"
  /files/blah/blah.properties/section/#comment[1] = "###################################################################################"
  /files/blah/blah.properties/section/#comment[2] = "Properties specified below are all NOT enabled with auto-reload option."
  /files/blah/blah.properties/section/#comment[3] = "So any change in this file requires server restart"
  /files/blah/blah.properties/section/#comment[4] = "###################################################################################"
  /files/blah/blah.properties/section/database.migration.cleanOnStartup = "false"


Additional info:
With the 1.1.0 lens the following works (and is how I generated the expected above):

augtool -t 'IniFile.lns_loose incl /path/to/ini'

Comment 1 Dominic Cleal 2014-03-05 17:50:23 UTC
Upstream's 96042e5 fixes this.

Just to clarify, the reproducer steps are for the basic INI-file support exposed in 1.0.0, e.g.

Steps to Reproduce (before):
1. echo "database.migration.cleanOnStartup=false" > /tmp/test.ini
2. augtool -t 'Puppet.lns incl /tmp/test.ini' print /files/tmp/test.ini
3. augtool -t 'Puppet.lns incl /tmp/test.ini' print /augeas//error

And as per additional info above, change the augtool command to use IniFile.lns_loose once fixed:

augtool -t 'IniFile.lns_loose incl /tmp/test.ini'

Comment 3 Lingfei Kong 2014-06-13 03:11:03 UTC
Verified with augeas-1.0.0-6.el6
Steps to verify:
1. 1. echo "database.migration.cleanOnStartup=false" > /tmp/test.ini
2. # augtool -t 'IniFile.lns_loose incl /tmp/test.ini' print /augeas//error
<no output>
3. Check file: /usr/share/augeas/lenses/dist/inifile.aug, A new lense is added: lns_loose

Comment 4 errata-xmlrpc 2014-10-14 07:15:44 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.

http://rhn.redhat.com/errata/RHBA-2014-1517.html