Imported Upstream version 1.4.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 set_kw = [ Util.del_str "set" . Util.del_ws_spc . label "@set" ]
24
25 let no_inline_comment_entry (kw:regexp) (sep:lens) (comment:lens)
26                        = [ set_kw? . key kw . sep . IniFile.sto_to_eol? . eol ]
27                          | comment
28                          | [ seq "urls" . store url_entry . eol ]
29
30 let entry_re           = ( /[A-Za-z][:#A-Za-z0-9._-]+/ )
31
32 let entry   = no_inline_comment_entry entry_re sep comment
33
34 (************************************************************************
35  *                        RECORD
36  *************************************************************************)
37
38 let title   = IniFile.title IniFile.record_re
39
40 let record  = IniFile.record title entry
41
42 (************************************************************************
43  *                        LENS & FILTER
44  *************************************************************************)
45 let lns     = IniFile.lns record comment
46
47 let filter = ((incl "/etc/glance/*.ini")
48              . (incl "/etc/keystone/keystone.conf")
49              . (incl "/etc/nova/api-paste.ini")
50              . (incl "/etc/swift/swift.conf")
51              . (incl "/etc/swift/proxy-server.conf")
52              . (incl "/etc/swift/account-server/*.conf")
53              . (incl "/etc/swift/container-server/*.conf")
54              . (incl "/etc/swift/object-server/*.conf"))
55
56 let xfm = transform lns filter