Removed unnecessary catches

This commit is contained in:
Alberto Soutullo 2023-03-09 16:43:31 +01:00 committed by Alberto Soutullo Rendo
parent da8cfe8377
commit f4fb0bdd45
1 changed files with 4 additions and 13 deletions

View File

@ -1,6 +1,5 @@
# Python Imports
import json
import sys
# Project Imports
from src.utils import wls_logger
@ -8,24 +7,16 @@ from src.utils import wls_logger
def load_config_file(config_file):
""" Load config file """
try:
with open(config_file, 'r') as f:
config = json.load(f)
except Exception as e:
wls_logger.G_LOGGER.error('%s: %s' % (e.__doc__, e))
sys.exit()
with open(config_file, 'r') as f:
config = json.load(f)
return config
def load_topology(topology_file):
""" Load topology """
try:
with open(topology_file, 'r') as read_file:
topology = json.load(read_file)
except Exception as e:
wls_logger.G_LOGGER.error('%s: %s' % (e.__doc__, e))
sys.exit()
with open(topology_file, 'r') as read_file:
topology = json.load(read_file)
wls_logger.G_LOGGER.debug(topology)
wls_logger.G_LOGGER.info('Topology loaded')