Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103762828
readconf.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Mar 4, 14:34
Size
564 B
Mime Type
text/x-python
Expires
Thu, Mar 6, 14:34 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24658045
Attached To
R11599 sausage-binary
readconf.py
View Options
import
configparser
class
ReadConf
(
object
):
def
__init__
(
self
):
self
.
options
=
{}
self
.
cfg_parser
=
configparser
.
ConfigParser
()
self
.
cfg_parser
.
read
(
"/etc/sausage/sausage.cfg"
)
ReadConf
.
hosts
=
[
i
for
i
in
self
.
cfg_parser
[
"server"
]
.
get
(
"urls"
)
.
split
(
","
)]
ReadConf
.
clusters
=
[
i
.
replace
(
" "
,
""
)
for
i
in
self
.
cfg_parser
[
"default"
]
.
get
(
"clusters"
)
.
split
(
","
)
]
ReadConf
.
indexes
=
self
.
cfg_parser
[
"server"
]
.
get
(
"index"
)
ReadConf
.
fields
=
dict
(
self
.
cfg_parser
[
"fields"
])
Event Timeline
Log In to Comment