From 5a191a7449347ed5c419720de89d2e4a0194c21e Mon Sep 17 00:00:00 2001 From: Alex Stancu Date: Fri, 24 Jul 2020 15:55:17 +0300 Subject: [PATCH] Bug fix. VES Endpoint basic-auth issue. Issue-ID: SIM-36 Change-Id: I7cfc6538b6287a9ef662f4356f6bfc656fecd8bf Signed-off-by: Alex Stancu --- ntsimulator/scripts/docker-compose.yml | 1 + .../src/ntsimulator-manager/ntsimulator-manager.c | 56 ++++++++++++---------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/ntsimulator/scripts/docker-compose.yml b/ntsimulator/scripts/docker-compose.yml index 710f46b..0a4c04a 100644 --- a/ntsimulator/scripts/docker-compose.yml +++ b/ntsimulator/scripts/docker-compose.yml @@ -15,6 +15,7 @@ services: environment: #NTS_IP: "2001:db8:1::1" NTS_IP: "10.20.11.121" + #EXTERNAL_NTS_IP: "8.8.8.8" NETCONF_BASE: 50000 DOCKER_ENGINE_VERSION: "1.40" #MODELS_IMAGE: "ntsim_onf_core_model_1_2" diff --git a/ntsimulator/src/ntsimulator-manager/ntsimulator-manager.c b/ntsimulator/src/ntsimulator-manager/ntsimulator-manager.c index b4e1a0f..3571ab4 100644 --- a/ntsimulator/src/ntsimulator-manager/ntsimulator-manager.c +++ b/ntsimulator/src/ntsimulator-manager/ntsimulator-manager.c @@ -309,36 +309,44 @@ simulator_config_change_cb(sr_session_ctx_t *session, const char *module_name, s goto sr_error; } - sr_free_val(val); - val = NULL; + if (strcmp(val->data.enum_val, "basic-auth") == 0) + { + sr_free_val(val); + val = NULL; - /* get the value from sysrepo, we do not care if the value did not change in our case */ - rc = sr_get_item(session, "/network-topology-simulator:simulator-config/ves-endpoint-details/ves-endpoint-username", &val); - if (rc != SR_ERR_OK) { - goto sr_error; - } + /* get the value from sysrepo, we do not care if the value did not change in our case */ + rc = sr_get_item(session, "/network-topology-simulator:simulator-config/ves-endpoint-details/ves-endpoint-username", &val); + if (rc != SR_ERR_OK) { + goto sr_error; + } - rc = ves_username_changed(val->data.string_val); - if (rc != SR_ERR_OK) { - goto sr_error; - } + rc = ves_username_changed(val->data.string_val); + if (rc != SR_ERR_OK) { + goto sr_error; + } - sr_free_val(val); - val = NULL; + sr_free_val(val); + val = NULL; - /* get the value from sysrepo, we do not care if the value did not change in our case */ - rc = sr_get_item(session, "/network-topology-simulator:simulator-config/ves-endpoint-details/ves-endpoint-password", &val); - if (rc != SR_ERR_OK) { - goto sr_error; - } + /* get the value from sysrepo, we do not care if the value did not change in our case */ + rc = sr_get_item(session, "/network-topology-simulator:simulator-config/ves-endpoint-details/ves-endpoint-password", &val); + if (rc != SR_ERR_OK) { + goto sr_error; + } - rc = ves_password_changed(val->data.string_val); - if (rc != SR_ERR_OK) { - goto sr_error; - } + rc = ves_password_changed(val->data.string_val); + if (rc != SR_ERR_OK) { + goto sr_error; + } - sr_free_val(val); - val = NULL; + sr_free_val(val); + val = NULL; + } + else + { + sr_free_val(val); + val = NULL; + } /* get the value from sysrepo, we do not care if the value did not change in our case */ rc = sr_get_item(session, "/network-topology-simulator:simulator-config/ves-endpoint-details/ves-endpoint-port", &val); -- 2.16.6