Merge pull request #22 in KSC/webapp-tools from malberts/files_adminpy-1575907755669 to master
* commit '0bb89137943a7406064185c8f6299334cfa39a0a': Add check for settings key
This commit is contained in:
commit
384cb70e4b
@ -54,6 +54,14 @@ def files(options):
|
|||||||
files = options.file.split(',')
|
files = options.file.split(',')
|
||||||
for file in files:
|
for file in files:
|
||||||
configfile = ConfigObj(file)
|
configfile = ConfigObj(file)
|
||||||
|
|
||||||
|
# Check if the settings section key is present in the file
|
||||||
|
try:
|
||||||
|
value = configfile['setting']
|
||||||
|
except KeyError:
|
||||||
|
print('Setting does not exist in', file)
|
||||||
|
continue
|
||||||
|
|
||||||
if configfile['setting'].as_bool('use_zarafa_credentials'):
|
if configfile['setting'].as_bool('use_zarafa_credentials'):
|
||||||
username = options.user
|
username = options.user
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user