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

Story SW-300: renaming tile to element

parent 43d0dcc4
No related branches found
No related tags found
2 merge requests!89Monitoring maintenance Epic branch merge,!1Resolve OSB-13 "Monitoringmaintenance "
......@@ -28,10 +28,5 @@ python_install(${_py_files} DESTINATION lofar/maintenance/utils)
install(PROGRAMS ${_bin_files}
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES requirements.txt
DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES fabfile.py
DESTINATION ${CMAKE_INSTALL_PREFIX})
add_subdirectory(test)
......@@ -263,13 +263,13 @@ def print_out_component_errors(station_test):
:param station_test: the dict that contains the station_test
"""
excluded_fields = {'parent', 'resourcetype', 'polymorphic_ctype', 'id', 'station_test_id',
'tile_errors',
'element_errors',
'parent_component_error'}
summary_fields = ['component_type', 'component_id', 'error_type']
tile_summary_fields = ['tile_id']
element_summary_fields = ['element_id']
component_error_indentation = ' ' * 3
tile_error_indentation = ' ' * 5
element_error_indentation = ' ' * 5
print()
print('=' * 5 + 'Details' + '=' * 5)
......@@ -296,17 +296,19 @@ def print_out_component_errors(station_test):
for key, value in details:
print(component_error_indentation + key + ' ' + str(value))
tile_errors = error.get('tile_errors', None)
if tile_errors:
for k, tile_error in enumerate(tile_errors):
tile_error_string = 'Tile error #{} on tile id {}'.format(k, tile_error['tile_id'])
print(tile_error_indentation + tile_error_string)
print(tile_error_indentation + '-' * len(tile_error_string))
tile_keys = set(tile_error.keys()) - set(tile_summary_fields) - excluded_fields
tile_values = [tile_error[key] for key in tile_keys]
for tile_key, tile_value in zip(tile_keys, tile_values):
print(tile_error_indentation + tile_key + ' ' + str(tile_value))
element_errors = error.get('tile_errors', None)
if element_errors:
for k, element_error in enumerate(element_errors):
element_error_string = 'Element error #{} on element id {}'.format(k, element_error[
'element_id'])
print(element_error_indentation + element_error_string)
print(element_error_indentation + '-' * len(element_error_string))
element_keys = set(element_error.keys()) - set(
element_summary_fields) - excluded_fields
element_values = [element_error[key] for key in element_keys]
for element_key, element_value in zip(element_keys, element_values):
print(element_error_indentation + element_key + ' ' + str(element_value))
print()
print('\n')
......
......@@ -37,7 +37,8 @@ def rsync_compressed(c, from_path='address', to_path='address'):
def configure_remote_server(c, type):
# Copying django settings file
from_path = os.path.join(REMOTE_DIR, type, BASE_SETTINGS_FILE_PATH)
to_path = os.path.join(REMOTE_DIR, type, REMOTE_INSTALL_DIR, PATH_SETTINGS_FILE)
to_path = os.path.join(
REMOTE_DIR, type, REMOTE_INSTALL_DIR, PATH_SETTINGS_FILE)
print('copying django settings file {} to {}'.format(from_path, to_path))
cp_cmd = 'cp {} {}'.format(from_path, to_path)
c.run(cp_cmd)
......@@ -55,6 +56,7 @@ def _connection(type):
user = users[type]
return Connection(host, user=user)
@task
def run_server(c, type):
deploy_dir = os.path.join(REMOTE_DIR, type)
......@@ -65,13 +67,14 @@ def run_server(c, type):
with c.cd(deploy_dir):
cmd = 'sh {} start'.format(start_script)
print('executing command',cmd)
print('executing command', cmd)
print(c.run(cmd, pty=False))
time.sleep(5)
print('log can be found at', log_path)
c.run('tail {}'.format(log_path))
@task
def tear_down_server(c, type):
deploy_dir = os.path.join(REMOTE_DIR, type)
......
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