Bug 1145495

Summary: Make the LVM lens able to handle /etc/lvm/lvm.conf
Product: Red Hat Enterprise Linux 7 Reporter: Pino Toscano <ptoscano>
Component: augeasAssignee: Dominic Cleal <dcleal>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: lkong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: augeas-1.1.0-16.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:26:14 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:
Bug Depends On:    
Bug Blocks: 1144927    

Description Pino Toscano 2014-09-23 08:09:42 UTC
Description of problem:
Since few weeks (development release 1.27.32), libguestfs uses a copy of the upstream lvm.aug lens, with a simple modification to handle negative integer values, to properly edit /etc/lvm/lvm.conf.
We did that (carrying a copy) because this the old way (i.e. manually editing /etc/lvm/lvm.conf with manual search & replace) was too fragile, and it broke with newer lvm2 releases.
The proposed changes for lvm.aug have been sent upstream [1], although they have not been reviewed yet at this current time.

Thus, it would be nice if the Augeas in RHEL 7.1 could provide these improvements, which would ease our implementation a bit (especially because libguestfs 1.27.x/1.28.x is in RHEL 7.1).

[1] https://github.com/hercules-team/augeas/pull/155

Version-Release number of selected component (if applicable):
1.1.0-15.el7

Comment 2 Dominic Cleal 2014-09-23 08:28:03 UTC
Fixed in ae8da966, 6b15f76f

Comment 4 Lingfei Kong 2014-11-10 08:57:58 UTC
Verify with augeas-1.1.0-16.el7

Steps to verify:
1. #find  /usr/share/augeas/lenses/dist/ -name lvm.aug
/usr/share/augeas/lenses/dist/lvm.aug

2. #augtool print /augeas/files/etc/lvm/lvm.conf 
/augeas/files/etc/lvm/lvm.conf
/augeas/files/etc/lvm/lvm.conf/path = "/files/etc/lvm/lvm.conf"
/augeas/files/etc/lvm/lvm.conf/mtime = "1414473460"
/augeas/files/etc/lvm/lvm.conf/lens = "@LVM"
/augeas/files/etc/lvm/lvm.conf/lens/info = "/usr/share/augeas/lenses/dist/lvm.aug:67.11-.26:"

3. #augtool print /files/etc/lvm/lvm.conf
/files/etc/lvm/lvm.conf
/files/etc/lvm/lvm.conf/#comment[1] = "This is an example configuration file for the LVM2 system."
/files/etc/lvm/lvm.conf/#comment[2] = "It contains the default settings that would be used if there was no"
/files/etc/lvm/lvm.conf/#comment[3] = "/etc/lvm/lvm.conf file."
/files/etc/lvm/lvm.conf/#comment[4] = "Refer to 'man lvm.conf' for further information including the file layout."
/files/etc/lvm/lvm.conf/#comment[5] = "To put this file in a different directory and override /etc/lvm set"
/files/etc/lvm/lvm.conf/#comment[6] = "the environment variable LVM_SYSTEM_DIR before running the tools."
/files/etc/lvm/lvm.conf/#comment[7] = "N.B. Take care that each setting only appears once if uncommenting"
/files/etc/lvm/lvm.conf/#comment[8] = "example settings in this file."
/files/etc/lvm/lvm.conf/#comment[9] = "This section allows you to set the way the configuration settings are handled."
[...]

Comment 6 errata-xmlrpc 2015-03-05 09:26:14 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-0399.html