Commit c44be7fb authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - Mock NCE-FAN Controller

- Configured private YANG models
- Made SIMAP optional
parent db06508c
Loading
Loading
Loading
Loading
+41 −37
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
# limitations under the License.


import json, logging, secrets
import json, logging, os, secrets
from flask import Flask
from flask_restful import Api
from .Dispatch import RestConfDispatch
@@ -46,8 +46,12 @@ with open(STARTUP_FILE, mode='r', encoding='UTF-8') as fp:
    YANG_STARTUP_DATA = json.loads(fp.read())


SIMAP_ADDRESS = os.environ.get('SIMAP_ADDRESS')
SIMAP_PORT    = os.environ.get('SIMAP_PORT'   )

if SIMAP_ADDRESS is not None and SIMAP_PORT is not None:
    restconf_client = RestConfClient(
    '172.17.0.1', port=8080,
        SIMAP_ADDRESS, port=SIMAP_PORT,
        logger=logging.getLogger('RestConfClient')
    )
    simap_client = SimapClient(restconf_client)
+17 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI 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.


# Add here folders containing non-public data models
private-*/