Merge branch 'cc-5709-airtime-analyzer-cloud-storage' into cc-5709-airtime-analyzer-cloud-storage-saas
This commit is contained in:
commit
88b39e16bb
1 changed files with 15 additions and 0 deletions
15
python_apps/airtime_analyzer/airtime_analyzer/config_file.py
Normal file
15
python_apps/airtime_analyzer/airtime_analyzer/config_file.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import ConfigParser
|
||||||
|
|
||||||
|
def read_config_file(config_path):
|
||||||
|
"""Parse the application's config file located at config_path."""
|
||||||
|
config = ConfigParser.SafeConfigParser()
|
||||||
|
try:
|
||||||
|
config.readfp(open(config_path))
|
||||||
|
except IOError as e:
|
||||||
|
print "Failed to open config file at " + config_path + ": " + e.strerror
|
||||||
|
exit(-1)
|
||||||
|
except Exception as e:
|
||||||
|
print e.strerror
|
||||||
|
exit(-1)
|
||||||
|
|
||||||
|
return config
|
Loading…
Add table
Add a link
Reference in a new issue