1 # Copyright 2015 Intel Corporation.
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.
14 """VNF Controller for the P2P scenario
19 from core.vnf_controller import IVnfController
21 class VnfControllerP2P(IVnfController):
22 """VNF controller for the P2P scenario.
24 Does nothing as there is no VNF in P2P
27 _vnf_class: A class object representing the VNF to be used.
28 _deployment_scenario: A string describing the scenario to set-up in the
30 _vnfs: A list of vnfs controlled by the controller.
33 #TODO: Decide on contextmanager or __enter/exit__ strategy <MH 2015-05-01>
34 def __init__(self, vnf_class):
35 """Sets up the VNF infrastructure for the P2P deployment scenario.
37 :param vnf_class: The VNF class to be used, this is mostly ignored.
39 self._logger = logging.getLogger(__name__)
40 self._vnf_class = vnf_class
41 self._deployment_scenario = "P2P"
42 self._logger.debug('__init__ with ' + str(self._vnf_class))
45 """Returns an empty list of vnfs.
47 self._logger.debug('get_vnfs with ' + str(self._vnf_class))
53 self._logger.debug('start with ' + str(self._vnf_class))
58 self._logger.debug('stop with ' + str(self._vnf_class))
63 def __exit__(self, type_, value, traceback):