Skip to content

Commit

Permalink
Merge pull request #78 from HusseinKabbout/master
Browse files Browse the repository at this point in the history
Don't fail config generation when index.html file is not found
  • Loading branch information
manisandro authored Jul 26, 2024
2 parents 577717b + c65e0b6 commit 72735b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/config_generator/map_viewer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,15 @@ def copy_index_html(self):
# additional service config
cfg_generator_config = self.service_config.get('generator_config', {})
cfg_qwc2_config = cfg_generator_config.get('qwc2_config', {})
index_file = cfg_qwc2_config.get('qwc2_index_file', 'index.html')

if not os.path.exists(index_file):
self.logger.warning("Could not copy QWC2 index.html: File was not found")
return

self.logger.info("Copying 'index.html' to tenant dir")
try:
# read index.html
index_file = cfg_qwc2_config.get('qwc2_index_file', 'index.html')
index_contents = None
with open(index_file, encoding='utf-8') as f:
index_contents = f.read()
Expand Down

0 comments on commit 72735b5

Please sign in to comment.