-
Notifications
You must be signed in to change notification settings - Fork 1
/
leader.py
27 lines (20 loc) · 971 Bytes
/
leader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from collections import namedtuple
Config = namedtuple("Configuration", ['session_id', 'host', 'database', 'user_name', 'password', 'access_key', 'secret_key', 'topicarn'])
def load_config():
try:
metadata_file = open('_config', 'r')
session_id = metadata_file.readline().strip()
host = metadata_file.readline().strip()
database = metadata_file.readline().strip()
user_name = metadata_file.readline().strip()
password = metadata_file.readline().strip()
access_key = metadata_file.readline().strip()
secret_key = metadata_file.readline().strip()
topicarn = metadata_file.readline().strip()
metadata_file.close()
except Exception, e:
print 'problem parsing assignment metadata file'
print 'exception message:'
print e
quit()
return Config(session_id, host, database, user_name, password, access_key, secret_key, topicarn)