diff --git a/LCU/Maintenance/DBInterface/django_postgresql/settings.py b/LCU/Maintenance/DBInterface/django_postgresql/settings.py index 35241361d9050c8b57d73aa60ccc81043620fe36..85bacb9ae5bf41d5c0b6e38429cb519bb9bafbd1 100644 --- a/LCU/Maintenance/DBInterface/django_postgresql/settings.py +++ b/LCU/Maintenance/DBInterface/django_postgresql/settings.py @@ -30,7 +30,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'x)5=9*2a&)32h-loh@rlt_9eyw%t$-fqao*#1j2gh^7=^bnjyy' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['lofarmonitortest.control.lofar', 'localhost', '127.0.0.1'] @@ -95,12 +95,6 @@ LOGGING = { 'class': 'logging.StreamHandler', 'formatter': 'verbose', 'level': 'DEBUG' - }, - 'log_file': { - 'level': 'DEBUG', - 'class': 'logging.FileHandler', - 'formatter': 'verbose', - 'filename': './debug.log', } }, 'loggers': { @@ -134,7 +128,7 @@ LOGGING = { # # contents should be like this (adapt as needed): # -# [database:lsmr] +# [database:mdb] # type = postgresql # host = localhost # database = <your_lsmr_database_name> @@ -151,7 +145,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': django_db_credentials.database, 'USER': django_db_credentials.user, - 'PASS': django_db_credentials.password, + 'PASSWORD': django_db_credentials.password, 'HOST': django_db_credentials.host, 'PORT': django_db_credentials.port, } @@ -201,4 +195,4 @@ REST_FRAMEWORK = { CELERY_RESULT_BACKEND = 'amqp://guest@localhost//' # LOFAR SPECIFIC PARAMETERS -URL_TO_STORE_RTSM_PLOTS = './' \ No newline at end of file +URL_TO_STORE_RTSM_PLOTS = '/data/deploy/production/rtsm_plots' \ No newline at end of file diff --git a/LCU/Maintenance/DBInterface/django_postgresql/utils.py b/LCU/Maintenance/DBInterface/django_postgresql/utils.py index 2b07c52cf0ba8c668391aeb48fec39c9b0292ead..8b341977dace7411a2307171b9dd7764f47716c2 100644 --- a/LCU/Maintenance/DBInterface/django_postgresql/utils.py +++ b/LCU/Maintenance/DBInterface/django_postgresql/utils.py @@ -16,7 +16,7 @@ def test_database_configuration(): 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'test_mdb', 'USER': ''.join(random.sample(string.ascii_lowercase, 10)), - 'PASS': ''.join(random.sample(string.ascii_letters, 10)), + 'PASSWORD': ''.join(random.sample(string.ascii_letters, 10)), 'HOST': 'localhost', 'PORT': free_random_port() } \ No newline at end of file diff --git a/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py b/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py index 760afd18da173e2cb77b3de4326e2a45eead571d..2b6e223163be797f779335ce9da3aab12978d527 100644 --- a/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py +++ b/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py @@ -33,6 +33,7 @@ def parse_date(date): except Exception as e: raise ValueError('cannot parse %s with format %s - %s' % (date, expected_format, e)) +echo docker run --rm -it --net host - -v$PWD/datapoint_config_production.xml:/root/datapoint_config.xml^Cofar/winccdbbridge /root/datapoint_config.xml /root/db.ini def parse_bool(boolean_value_str): boolean_value_str = boolean_value_str.lower() @@ -58,7 +59,10 @@ def _get_unique_error_types(): :return: the list containing the unique error types :rtype: list """ - return [item['type'] for item in ComponentError.objects.values('type').distinct()] + try: + return [item['type'] for item in ComponentError.objects.values('type').distinct()] + except: + return [] def rcu_from_antenna_type_polarization(antenna_id, type, polarization): diff --git a/LCU/Maintenance/DBInterface/test/CMakeLists.txt b/LCU/Maintenance/DBInterface/test/CMakeLists.txt index fc1612413fffa82859cd1a17b5212d068c172e49..3f911dd1c628e572059b6f8447e1982c110c64a0 100644 --- a/LCU/Maintenance/DBInterface/test/CMakeLists.txt +++ b/LCU/Maintenance/DBInterface/test/CMakeLists.txt @@ -1,3 +1,8 @@ +set(py_files __init__.py + postgres_testrunner.py) + +python_install(${py_files} DESTINATION lofar/maintenance/test) + add_subdirectory(controllers) add_subdirectory(models) \ No newline at end of file diff --git a/LCU/Maintenance/DBInterface/test/models/CMakeLists.txt b/LCU/Maintenance/DBInterface/test/models/CMakeLists.txt index f46339586de145398d81c9d2ebfeec810ad99f9c..35ae97d5c25a4541c535226d1c1aa8d29a18900f 100644 --- a/LCU/Maintenance/DBInterface/test/models/CMakeLists.txt +++ b/LCU/Maintenance/DBInterface/test/models/CMakeLists.txt @@ -3,9 +3,7 @@ include(LofarCTestPython) enable_coverage(3) -set(py_files postgres_testrunner.py - __init__.py - test_rtsm_models.py +set(py_files test_rtsm_models.py test_wincc_models.py) python_install(${py_files} DESTINATION lofar/maintenance/test) diff --git a/LCU/Maintenance/MDB_tools/requirements.txt b/LCU/Maintenance/MDB_tools/requirements.txt index a5c98b8302820e3f6c639fbe38ad738d8970e8ab..3a806000efadca42d147832bef0f09abe00952f5 100644 --- a/LCU/Maintenance/MDB_tools/requirements.txt +++ b/LCU/Maintenance/MDB_tools/requirements.txt @@ -8,4 +8,8 @@ gunicorn fabric invocations beautifultable -blessings \ No newline at end of file +blessings +celery +django-filter +coreapi +matplotlib \ No newline at end of file