Bug fix. 48/4448/1
authorAlex Stancu <alexandru.stancu@highstreet-technologies.com>
Fri, 24 Jul 2020 12:55:17 +0000 (15:55 +0300)
committerAlex Stancu <alexandru.stancu@highstreet-technologies.com>
Fri, 24 Jul 2020 12:55:34 +0000 (15:55 +0300)
VES Endpoint basic-auth issue.

Issue-ID: SIM-36
Change-Id: I7cfc6538b6287a9ef662f4356f6bfc656fecd8bf
Signed-off-by: Alex Stancu <alexandru.stancu@highstreet-technologies.com>
ntsimulator/scripts/docker-compose.yml
ntsimulator/src/ntsimulator-manager/ntsimulator-manager.c

index 710f46b..0a4c04a 100644 (file)
@@ -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"
index b4e1a0f..3571ab4 100644 (file)
@@ -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);