Commit 22e34f4d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Code cleanup

parent 88131d5b
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -20,8 +20,7 @@
export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"


# Set the list of components, separated by spaces, you want to build images for, and deploy.
# Set the list of components, separated by spaces, you want to build images for, and deploy.
# export TFS_COMPONENTS="context device pathcomp service slice nbi webui"
export TFS_COMPONENTS="context device pathcomp service slice nbi webui"
export TFS_COMPONENTS="context device pathcomp service webui"


# Uncomment to activate Monitoring (old)
# Uncomment to activate Monitoring (old)
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
@@ -141,7 +140,7 @@ export CRDB_PASSWORD="tfs123"
export CRDB_DEPLOY_MODE="single"
export CRDB_DEPLOY_MODE="single"


# Disable flag for dropping database, if it exists.
# Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS="YES"
export CRDB_DROP_DATABASE_IF_EXISTS=""


# Disable flag for re-deploying CockroachDB from scratch.
# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY=""
export CRDB_REDEPLOY=""
+2 −4
Original line number Original line Diff line number Diff line
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
@@ -15,10 +14,9 @@


anytree==2.8.0
anytree==2.8.0
APScheduler>=3.10.4
APScheduler>=3.10.4
APScheduler>=3.10.4
confluent-kafka==2.3.*
confluent-kafka==2.3.*
deepdiff==6.7.*
kafka-python==2.0.6
kafka-python==2.0.6
numpy==2.0.1
numpy==2.0.1
pytz>=2025.2
deepdiff==6.7.*
pygnmi==0.8.14
pygnmi==0.8.14
pytz>=2025.2
+0 −11
Original line number Original line Diff line number Diff line
@@ -20,17 +20,6 @@ docker network rm --force qkd-node-br
# Create Docker network
# Create Docker network
docker network create --driver bridge --subnet=172.254.250.0/24 --gateway=172.254.250.254 qkd-node-br
docker network create --driver bridge --subnet=172.254.250.0/24 --gateway=172.254.250.254 qkd-node-br


cd $PROJECTDIR/src
# RCFILE=$PROJECTDIR/coverage/.coveragerc

# export KFK_SERVER_ADDRESS='127.0.0.1:9092'
# CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}')
# export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_telemetry?sslmode=require"
RCFILE=$PROJECTDIR/coverage/.coveragerc

python3 -m pytest --log-level=info --log-cli-level=info --verbose \
    telemetry/backend/tests/gnmi_oc/test_complete_GnmiOCcollector.py # this is integration test
    # telemetry/backend/tests/gnmi_oc/test_GnmiOpenConfigCollector.py # this is unit test
# Create QKD Node
# Create QKD Node
docker run --detach --name qkd-node --network qkd-node-br --ip 172.254.250.101 mock-qkd-node:test
docker run --detach --name qkd-node --network qkd-node-br --ip 172.254.250.101 mock-qkd-node:test


+0 −11
Original line number Original line Diff line number Diff line
@@ -23,14 +23,3 @@ def verify_password(username, password):
    if username not in RESTAPI_USERS: return None
    if username not in RESTAPI_USERS: return None
    if not check_password_hash(RESTAPI_USERS[username], password): return None
    if not check_password_hash(RESTAPI_USERS[username], password): return None
    return username
    return username
import os

def returnConfigFile(config_db):
    try:
        configFilePath = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..','..','..','..','..', 'data', config_db)
        with open(configFilePath, 'r', encoding='utf-8') as configFile:
            content = configFile.read()
    except FileNotFoundError:
        return None

    return content
+0 −11
Original line number Original line Diff line number Diff line
@@ -23,14 +23,3 @@ def returnConfigFile(config_db):
        return None
        return None


    return content
    return content
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import check_password_hash
from ztp_server.Config import RESTAPI_USERS

HTTP_AUTH = HTTPBasicAuth()

@HTTP_AUTH.verify_password
def verify_password(username, password):
    if username not in RESTAPI_USERS: return None
    if not check_password_hash(RESTAPI_USERS[username], password): return None
    return username
 No newline at end of file