- #TODO - full mapping from all deployment_scenarios to
- #correct controller class
- deployment_scenario = deployment_scenario.lower()
- if deployment_scenario.find("p2p") >= 0:
- return VswitchControllerP2P(vswitch_class)
- elif deployment_scenario.find("pvp") >= 0:
- return VswitchControllerPVP(vswitch_class)
-
-def create_vnf(deployment_scenario, vnf_class):
- """Return a new IVnfController for the deployment_scenario.
+ # pylint: disable=too-many-return-statements
+ deployment = deployment_scenario.lower()
+ if deployment.startswith("p2p"):
+ return VswitchControllerP2P(deployment, vswitch_class, traffic)
+ elif deployment.startswith("pvp"):
+ return VswitchControllerPXP(deployment, vswitch_class, traffic)
+ elif deployment.startswith("pvvp"):
+ return VswitchControllerPXP(deployment, vswitch_class, traffic)
+ elif deployment.startswith("pvpv"):
+ return VswitchControllerPXP(deployment, vswitch_class, traffic)
+ elif deployment.startswith("op2p"):
+ return VswitchControllerOP2P(deployment, vswitch_class, traffic, tunnel_operation)
+ elif deployment.startswith("ptunp"):
+ return VswitchControllerPtunP(deployment, vswitch_class, traffic)
+ elif deployment.startswith("clean"):
+ return VswitchControllerClean(deployment, vswitch_class, traffic)
+ else:
+ raise RuntimeError("Unknown deployment scenario '{}'.".format(deployment))
+
+
+def create_vnf(deployment_scenario, vnf_class, extra_vnfs):
+ """Return a new VnfController for the deployment_scenario.