1 # Copyright (c) 2019 Bell Canada.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from abstract_ra_processor import AbstractRAProcessor
16 from blueprint_constants import *
17 from java.lang import Exception as JavaException
19 class DescriptionExample(AbstractRAProcessor):
21 def process(self, resource_assignment):
22 # get dependencies result
23 value = self.raRuntimeService.getStringFromResolutionStore("vf-module-type")
25 # logic based on dependency outcome
28 result = "This is the Virtual Firewall entity"
30 result = "This is the Virtual Sink entity"
32 result = "This is the Virtual Packet Generator"
34 # set value for resource getting currently resolved
35 self.set_resource_data_value(resource_assignment, result)
39 def recover(self, runtime_exception, resource_assignment):
40 log.error("Exception in the script {}", runtime_exception)
41 print(self.addError(runtime_exception.cause.message))