Fix getting config.ini.

Use config.ini
This commit is contained in:
Chmouel Boudjnah 2013-03-29 13:47:56 +01:00
parent f82b9dac11
commit dfe07b72dd
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -15,4 +15,3 @@ swiftclient/versioninfo
cover/
coverage.xml
doc/source/api/
etc/config.ini

View File

@ -27,11 +27,13 @@ class ConfigurationError(Exception):
pass
def parse_ini(inicfg=INIFILE):
def parse_ini(inicfg=None):
if hasattr(inicfg, 'read'):
fp = inicfg
elif os.path.exists(inicfg):
elif inicfg and os.path.exists(inicfg):
fp = open(inicfg)
elif inicfg is None and os.path.exists(INIFILE):
fp = open(INIFILE)
else:
raise ConfigurationError("Cannot found inicfg")