-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2016 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
"""
import logging
+import pexpect
from vnfs.vnf.vnf import IVnf
class VnfController(object):
self._deployment_scenario = deployment_scenario.upper()
if self._deployment_scenario == 'P2P':
self._vnfs = []
- if self._deployment_scenario == 'PVP':
+ elif self._deployment_scenario == 'PVP':
self._vnfs = [vnf_class()]
elif self._deployment_scenario == 'PVVP':
self._vnfs = [vnf_class(), vnf_class()]
+ elif self._deployment_scenario == 'OP2P':
+ self._vnfs = []
+ else:
+ self._vnfs = []
self._logger.debug('__init__ ' + str(len(self._vnfs)) +
' VNF[s] with ' + ' '.join(map(str, self._vnfs)))
"""
self._logger.debug('start ' + str(len(self._vnfs)) +
' VNF[s] with ' + ' '.join(map(str, self._vnfs)))
- for vnf in self._vnfs:
- vnf.start()
+ try:
+ for vnf in self._vnfs:
+ vnf.start()
+ except pexpect.TIMEOUT:
+ self.stop()
+ raise
def stop(self):
"""Stops all VNFs set-up by __init__.