Imported Upstream version 1.3.0
[platform/upstream/augeas.git] / lenses / pythonpaste.aug
1 (* Python paste config file lens for Augeas
2    Author: Dan Prince <dprince@redhat.com>
3 *)
4 module PythonPaste =
5   autoload xfm
6
7 (************************************************************************
8  * INI File settings
9  *************************************************************************)
10
11 let comment  = IniFile.comment "#" "#"
12
13 let sep        = IniFile.sep "=" "="
14
15 let eol     = Util.eol
16
17 (************************************************************************
18  *                        ENTRY
19  *************************************************************************)
20
21 let url_entry    = /\/[\/A-Za-z0-9.-_]* ?[:|=] [A-Za-z0-9.-_]+/
22
23 let no_inline_comment_entry (kw:regexp) (sep:lens) (comment:lens)
24                        = [ key kw . sep . IniFile.sto_to_eol? . eol ]
25                          | comment
26                          | [ seq "urls" . store url_entry . eol ]
27
28 let entry_re           = ( /[A-Za-z][:#A-Za-z0-9._-]+/ )
29
30 let entry   = no_inline_comment_entry entry_re sep comment
31
32 (************************************************************************
33  *                        RECORD
34  *************************************************************************)
35
36 let title   = IniFile.title IniFile.record_re
37
38 let record  = IniFile.record title entry
39
40 (************************************************************************
41  *                        LENS & FILTER
42  *************************************************************************)
43 let lns     = IniFile.lns record comment
44
45 let filter = ((incl "/etc/glance/*.ini")
46              . (incl "/etc/keystone/keystone.conf")
47              . (incl "/etc/nova/api-paste.ini")
48              . (incl "/etc/swift/swift.conf")
49              . (incl "/etc/swift/proxy-server.conf")
50              . (incl "/etc/swift/account-server/*.conf")
51              . (incl "/etc/swift/container-server/*.conf")
52              . (incl "/etc/swift/object-server/*.conf"))
53
54 let xfm = transform lns filter