From 01eff6bc81499a9e41395f6b384a5e893b366505 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sun, 17 Feb 2019 09:31:35 -0500 Subject: Netconf resolution service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0346c88cd11136561426260a206bd7bf07f90dd3 Issue-ID: CCSDK-1086 Signed-off-by: Alexis de Talhouët --- .../Scripts/python/NetconfRpcExample.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python') diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python/NetconfRpcExample.py b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python/NetconfRpcExample.py index acdb94aa..26c66b66 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python/NetconfRpcExample.py +++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python/NetconfRpcExample.py @@ -13,8 +13,8 @@ # limitations under the License. import netconf_constant +from common import ResolutionHelper from java.lang import Exception as JavaException -from netconfclient import NetconfClient from org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor import \ NetconfComponentFunction @@ -26,21 +26,23 @@ class NetconfRpcExample(NetconfComponentFunction): log = globals()[netconf_constant.SERVICE_LOG] print(globals()) nc = NetconfClient(log, self, "netconf-connection") - nc.connect() + rr = ResolutionHelper(self) - payload = "DEMO" + payload = rr.resolve_and_generate_message_from_template_prefix("hostname") + nc.connect() response = nc.lock(message_id="lock-123") if not response.isSuccess(): log.error(response.errorMessage) - # nc.edit_config(message_id="edit-config-1", message_content=payload,edit_default_peration="none") + nc.edit_config(message_id="edit-config-1", message_content=payload, + edit_default_peration="none") # nc.validate(message_id="validate-123") # nc.discard_change(message_id="discard-123") - # nc.validate(message_id="validate-123") - # nc.commit(message_id="commit-123") - # nc.unlock(message_id="unlock-123") - # nc.disconnect() + nc.validate(message_id="validate-123") + nc.commit(message_id="commit-123") + nc.unlock(message_id="unlock-123") + nc.disconnect() except JavaException, err: log.error("Java Exception in the script {}", err) -- cgit 1.2.3-korg