1 # Copyright (c) 2019 Bell Canada.
\r
3 # Licensed under the Apache License, Version 2.0 (the "License");
\r
4 # you may not use this file except in compliance with the License.
\r
5 # You may obtain a copy of the License at
\r
7 # http://www.apache.org/licenses/LICENSE-2.0
\r
9 # Unless required by applicable law or agreed to in writing, software
\r
10 # distributed under the License is distributed on an "AS IS" BASIS,
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 # See the License for the specific language governing permissions and
\r
13 # limitations under the License.
\r
15 import netconf_constant
\r
16 from common import ResolutionHelper
\r
17 from time import sleep
\r
18 from netconfclient import NetconfClient
\r
19 from org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor import \
\r
20 NetconfComponentFunction
\r
23 class ConfigDeploy(NetconfComponentFunction):
\r
25 def process(self, execution_request):
\r
26 log = globals()[netconf_constant.SERVICE_LOG]
\r
28 rr = ResolutionHelper(self)
\r
30 # Get meshed template from DB
\r
31 resolution_key = self.getDynamicProperties("resolution-key").asText()
\r
32 payload = rr.retrieve_resolved_template_from_database(resolution_key, "userconfig")
\r
36 def recover(self, runtime_exception, execution_request):
\r
37 log.error("Exception in the script {}", runtime_exception)
\r
38 print self.addError(runtime_exception.cause.message)
\r