diff --git a/.gitignore b/.gitignore index 6a53f106e2e4672ff537c618e221be0f97f83a22..e1f87cfd3842c264bd219237e9afe113d61c35bc 100644 --- a/.gitignore +++ b/.gitignore @@ -178,4 +178,4 @@ libyang/ **/logs/*.log.* # PySpark checkpoints -src/analytics/.spark/* \ No newline at end of file +src/analytics/.spark/* diff --git a/src/analytics/backend/requirements.in b/src/analytics/backend/requirements.in index e2917029ea6f8c1d4730773946c114e08ea74cc5..9df678fe819f33d479b8f5090ca9ac4eb1f4047c 100644 --- a/src/analytics/backend/requirements.in +++ b/src/analytics/backend/requirements.in @@ -13,4 +13,4 @@ # limitations under the License. pyspark==3.5.2 -confluent-kafka==2.3.* \ No newline at end of file +confluent-kafka==2.3.* diff --git a/src/analytics/frontend/__init__.py b/src/analytics/frontend/__init__.py index 234a1af6588c91f6a17f3963f69120cd6e2248d9..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 100644 --- a/src/analytics/frontend/__init__.py +++ b/src/analytics/frontend/__init__.py @@ -1,4 +1,3 @@ - # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/analytics/frontend/client/AnalyticsFrontendClient.py b/src/analytics/frontend/client/AnalyticsFrontendClient.py index bfa8cae45996762ab2f8dff860650322f8dc0208..90e95d661d46f24ae5ffaeb7bcfa19b7e1f36526 100644 --- a/src/analytics/frontend/client/AnalyticsFrontendClient.py +++ b/src/analytics/frontend/client/AnalyticsFrontendClient.py @@ -65,4 +65,4 @@ class AnalyticsFrontendClient: LOGGER.debug('SelectAnalyzers: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SelectAnalyzers(request) LOGGER.debug('SelectAnalyzers result: {:s}'.format(grpc_message_to_json_string(response))) - return response \ No newline at end of file + return response diff --git a/src/analytics/frontend/requirements.in b/src/analytics/frontend/requirements.in index 20000420cc70f07185bddc3b3668fe775eca9c13..d81b9ddbeafeff94c830d48ca5594e775b9ce240 100644 --- a/src/analytics/frontend/requirements.in +++ b/src/analytics/frontend/requirements.in @@ -17,4 +17,4 @@ confluent-kafka==2.3.* psycopg2-binary==2.9.* SQLAlchemy==1.4.* sqlalchemy-cockroachdb==1.4.* -SQLAlchemy-Utils==0.38.* \ No newline at end of file +SQLAlchemy-Utils==0.38.* diff --git a/src/analytics/frontend/service/AnalyticsFrontendService.py b/src/analytics/frontend/service/AnalyticsFrontendService.py index e702c0144d2bcdf0c07071e3a07cd070f0c9a357..42a7fc9b60418c1c0fc5af6f320ae5c330ce8871 100644 --- a/src/analytics/frontend/service/AnalyticsFrontendService.py +++ b/src/analytics/frontend/service/AnalyticsFrontendService.py @@ -25,4 +25,4 @@ class AnalyticsFrontendService(GenericGrpcService): self.analytics_frontend_servicer = AnalyticsFrontendServiceServicerImpl() def install_servicers(self): - add_AnalyticsFrontendServiceServicer_to_server(self.analytics_frontend_servicer, self.server) \ No newline at end of file + add_AnalyticsFrontendServiceServicer_to_server(self.analytics_frontend_servicer, self.server) diff --git a/src/analytics/frontend/service/__init__.py b/src/analytics/frontend/service/__init__.py index 234a1af6588c91f6a17f3963f69120cd6e2248d9..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 100644 --- a/src/analytics/frontend/service/__init__.py +++ b/src/analytics/frontend/service/__init__.py @@ -1,4 +1,3 @@ - # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/analytics/frontend/tests/__init__.py b/src/analytics/frontend/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 --- /dev/null +++ b/src/analytics/frontend/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/analytics/requirements.in b/src/analytics/requirements.in index 98cf9671034575f6c854eedfd39bf172631544e6..8ff30ddaad25c39713f2e6f68c8d9aebed74dad0 100644 --- a/src/analytics/requirements.in +++ b/src/analytics/requirements.in @@ -18,4 +18,4 @@ confluent-kafka==2.3.* psycopg2-binary==2.9.* SQLAlchemy==1.4.* sqlalchemy-cockroachdb==1.4.* -SQLAlchemy-Utils==0.38.* \ No newline at end of file +SQLAlchemy-Utils==0.38.* diff --git a/src/analytics/tests/__init__.py b/src/analytics/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee6f7071f145e06c3aeaefc09a43ccd88e619e3 --- /dev/null +++ b/src/analytics/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/kpi_manager/database/KpiEngine.py b/src/kpi_manager/database/KpiEngine.py index dff406de666b5f68539b8897fa26e0b3ad51286b..0fce7e3d36cf2f03a18f311c815719a4f17b2869 100644 --- a/src/kpi_manager/database/KpiEngine.py +++ b/src/kpi_manager/database/KpiEngine.py @@ -16,8 +16,6 @@ import logging, sqlalchemy from common.Settings import get_setting LOGGER = logging.getLogger(__name__) - -# CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@127.0.0.1:{:s}/{:s}?sslmode={:s}' CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@cockroachdb-public.{:s}.svc.cluster.local:{:s}/{:s}?sslmode={:s}' class KpiEngine: @@ -33,12 +31,10 @@ class KpiEngine: CRDB_SSLMODE = get_setting('CRDB_SSLMODE') crdb_uri = CRDB_URI_TEMPLATE.format( CRDB_USERNAME, CRDB_PASSWORD, CRDB_NAMESPACE, CRDB_SQL_PORT, CRDB_DATABASE, CRDB_SSLMODE) - # crdb_uri = CRDB_URI_TEMPLATE.format( - # CRDB_USERNAME, CRDB_PASSWORD, CRDB_SQL_PORT, CRDB_DATABASE, CRDB_SSLMODE) try: engine = sqlalchemy.create_engine(crdb_uri, echo=False) LOGGER.info(' KpiDBmanager initalized with DB URL: {:}'.format(crdb_uri)) except: # pylint: disable=bare-except # pragma: no cover LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri))) return None # type: ignore - return engine + return engine