[augeas-devel] is this inifile parseable? Dupe section names, sections identified by variable inside

Mol, Xavier (SCC) xavier.mol at kit.edu
Tue Apr 4 11:40:30 UTC 2017


Hi Ron.



> Before I start learning augeas, I need to know of this is doable, easy or hard to do, do I need to write a new ini file lens?

Augeas doesn't really take offence by sections sharing the same name, even the NodeIds could be identical, because within the Augeas 
tree representation the nodes will exist independently.

I haven't tried to parse any ini files with Augeas myself, yet. You could simply try to transform your exemplary file using the 
existing IniFile lenses and see what happens.



$ augtool -A

augtool> transform IniFile.lns_loose incl /path/to/mysql.ini

augtool> load

augtool> ls /files/path/to/mysql.ini



Ciao,

Xavier.



From: augeas-devel-bounces at redhat.com [mailto:augeas-devel-bounces at redhat.com] On Behalf Of Ron
Sent: Tuesday, April 04, 2017 1:19 PM
To: augeas-devel at redhat.com
Subject: [augeas-devel] is this inifile parseable? Dupe section names, sections identified by variable inside



Hi,



I bumped into augeas while writing a puppet module for MySQL Cluster, which uses a cluster ini file which seems rather specific:



[ndb_mgmd default]

DataDir=/var/lib/mysql



[ndb_mgmd]

NodeId=51

HostName=london



[ndb_mgmd]

NodeId=52

HostName=frankfurt



[ndbd default]

DataDir=/var/lib/mysql

NoOfReplicas=3    # Number of replicas

DataMemory=80M    # How much memory to allocate for data storage

IndexMemory=18M   # How much memory to allocate for index storage



[ndbd]

NodeId=1

HostName=london



[ndbd]

NodeId=2

HostName=frankfurt



[mysqld default]



[mysqld]

NodeId=61

HostName=london



[mysqld]

NodeId=62

HostName=frankfurt



There are sections which have the same name, but are unique because of the NodeId

parameter. Before I start learning augeas, I need to know of this is doable, easy or hard to do, do I need to write a new ini file 
lens?



Thanks for your insights,



Ron Arts



BTW sorry for misusing the devel list, but the IRC channel was deserted.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20170404/4806ce93/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6401 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20170404/4806ce93/attachment.p7s>


More information about the augeas-devel mailing list