[augeas-devel] Augeas Hosts_Access lens
Raphaël Pinson
raphael.pinson at camptocamp.com
Fri Mar 23 15:13:43 UTC 2012
Hi Eugene,
When you have questions about Augeas, it is easier to ask on the
mailing list (which I added as Cc) so that others can benefit from the
answers.
On Thu, Mar 22, 2012 at 5:47 PM, Eugene Vilensky <evilensky at gmail.com> wrote:
> I am using augtool 0.10.0 and your lens hosts_access.aug.
>
> How might I use your lense to interpret lines where there are multiple
> IP addresses separated by commas per daemon? Is the proper formatting
> to break them out into repeat statements of:
>
> sshd: IP1
> sshd: IP2
>
The easiest thing to know that is to try it in a file. Create a file
with multiple addresses and see how Augeas understands it (using
augtool for example, or augcheck from [0]).
The test file (in
/usr/share/augeas/lenses/tests/test_hosts_access.aug) also contains
some useful examples:
let multi_client = "sshd: 10.234. , 192.168.\n"
test Hosts_Access.lns get multi_client =
{ "1"
{ "process" = "sshd" }
{ "client" = "10.234." }
{ "client" = "192.168." }
}
which shows that multiple IPs get mapped as multiple "client" nodes.
>
> Also I think this lens does not recognize entries with
> ip/255.255.255.255 format?
That is true.
> Is there any way to implement this?
Just implemented it in commit 91633265b2e0ceef91997f266a6e178654d389a9. See [1].
[0] https://github.com/raphink/augeas-sandbox
[1] http://git.fedorahosted.org/git/?p=augeas.git;a=commit;h=91633265b2e0ceef91997f266a6e178654d389a9
Raphaël
More information about the augeas-devel
mailing list