Skip to content

Commit c3904b2

Browse files
Vladimir Kotalahornace
authored andcommitted
check None from get_configuration()
1 parent 0126a4d commit c3904b2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docker/start.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ def save_config(logger, uri, config_path):
244244
:param config_path: file path
245245
"""
246246

247-
logger.info('Saving configuration to {}'.format(config_path))
248247
config = get_configuration(logger, uri)
248+
if config is None:
249+
return
250+
251+
logger.info('Saving configuration to {}'.format(config_path))
249252
with open(config_path, "w+") as config_file:
250253
config_file.write(config)
251254

tools/src/main/python/opengrok_tools/reindex_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def get_logprop_file(logger, template, pattern, project):
6363
def get_config_file(logger, uri, headers=None, timeout=None):
6464
"""
6565
Get fresh configuration from the webapp and store it in temporary file.
66+
Return file name on success, None on failure.
6667
"""
6768
config = get_configuration(logger, uri, headers=headers, timeout=timeout)
6869
if config is None:

0 commit comments

Comments
 (0)