Commit 9d7eb54d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - Mock NCE-T Controller

- Made SIMAP optional
parent c44be7fb
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)