Fix getting config.ini.
Use config.ini
This commit is contained in:
parent
f82b9dac11
commit
dfe07b72dd
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,4 +15,3 @@ swiftclient/versioninfo
|
||||
cover/
|
||||
coverage.xml
|
||||
doc/source/api/
|
||||
etc/config.ini
|
||||
|
@ -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")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user