Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / components / model-catalog / blueprint-model / test-blueprint / baseconfiguration / Scripts / python / SampleRAProcessor.py
1 from abstract_ra_processor import AbstractRAProcessor
2 from blueprint_constants import *
3
4
5 class SampleRAProcessor(AbstractRAProcessor):
6
7     def __init__(self):
8         AbstractRAProcessor.__init__(self)
9
10     def process(self, execution_request):
11
12         AbstractRAProcessor.process(self, execution_request)
13         print "Processing calling..." + PROPERTY_BLUEPRINT_BASE_PATH
14         if self.ra_valid is True:
15             value = self.resolve_values_script(execution_request, self.value_to_resolve)
16             self.set_resource_data_value(execution_request, value)
17         else:
18             raise BluePrintProcessorException("Error on resource assignment. Message = " + self.error_message)
19         return None
20
21     def recover(self, runtime_exception, execution_request):
22         AbstractRAProcessor.recover(self, runtime_exception, execution_request)
23         print "Recovering calling..." + PROPERTY_BLUEPRINT_BASE_PATH
24         return None
25
26     def resolve_values_script(self, execution_request, value_to_resolve):
27         # TODO : DO business logic here
28         print "Resolve value for " + value_to_resolve + " here..."
29         return "test_python"