Skip to content
Snippets Groups Projects
Commit f36821b7 authored by Mattia Mancini's avatar Mattia Mancini
Browse files

SW-300: Fixing errors in mdb_loader.py

parent c91bb544
No related branches found
No related tags found
2 merge requests!89Monitoring maintenance Epic branch merge,!1Resolve OSB-13 "Monitoringmaintenance "
...@@ -72,7 +72,7 @@ def is_station_test(content): ...@@ -72,7 +72,7 @@ def is_station_test(content):
:return: True if the content refers to a station test :return: True if the content refers to a station test
""" """
pattern = r'(?:\d{8})(?:\,.*)*' pattern = r'(?:\d{8})(?:\,.*)*'
for line in content: for line in content.split('\n'):
if line is '': if line is '':
continue continue
if not re.match(pattern, line): if not re.match(pattern, line):
...@@ -87,7 +87,7 @@ def is_rtsm_test(content): ...@@ -87,7 +87,7 @@ def is_rtsm_test(content):
:return: True if the content refers to a RTSM :return: True if the content refers to a RTSM
""" """
pattern = r'(?:#\.*)|(?:[^0-9\,]*=.*)' pattern = r'(?:#\.*)|(?:[^0-9\,]*=.*)'
for line in content: for line in content.split('\n'):
if line is '': if line is '':
continue continue
if not re.match(pattern, line): if not re.match(pattern, line):
...@@ -102,7 +102,7 @@ def send_stationtest_rtsm_content_to_address(address, content): ...@@ -102,7 +102,7 @@ def send_stationtest_rtsm_content_to_address(address, content):
:param content: content of the API call :param content: content of the API call
:return: True if the request was successful False otherwise :return: True if the request was successful False otherwise
""" """
full_address = '/'.join([address, compose_api_url_for_given_test_type(content)]) full_address = '/'.join([address, compose_api_url_for_given_test_type(content['content'])])
logging.info('performing request to address %s', full_address) logging.info('performing request to address %s', full_address)
logging.debug('request content %s', content) logging.debug('request content %s', content)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment