Allow omitting working.directory in config.json acc. to README

README suggests that `working.directory` can be omitted from
`config.json`, but doing this will cause a KeyNotFoundException.

The dictionary lookup has been modified to include a default value of
`'.'` which is according to README.
This commit is contained in:
Egon Kidmose 2020-03-09 13:03:56 +01:00
parent 6c082c8fe4
commit 3ab555eeb6
No known key found for this signature in database
GPG key ID: 2934DEEE6F13A8FA

View file

@ -26,7 +26,7 @@ authen_base_url = config['authentication.base.url']
czds_base_url = config['czds.base.url']
# This is optional. Default to current directory
working_directory = config['working.directory']
working_directory = config.get('working.directory', '.') # Default to current directory
if not username:
sys.stderr.write("'icann.account.username' parameter not found in the config.json file\n")
@ -44,10 +44,6 @@ if not czds_base_url:
sys.stderr.write("'czds.base.url' parameter not found in the config.json file\n")
exit(1)
if not working_directory:
# Default to current directory
working_directory = '.'
##############################################################################################################