aboutsummaryrefslogtreecommitdiffstats
path: root/vswitches/ovs_vanilla.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2018-01-05 13:24:09 +0000
committerMartin Klozik <martinx.klozik@intel.com>2018-01-05 14:16:00 +0000
commit58d53561bad01ae7829fdeee0c67f5dae4a9dc34 (patch)
treeeb3c8288e4dff5cf9f8a3c5622689e436dd4399a /vswitches/ovs_vanilla.py
parentb47717bb0cf09f739feb4ee9b47173c28581bf20 (diff)
vswitch: Improve add_phy_port error messages
In case that vSwitch can't add required number of physical ports, then error message should be printed. Previous implementation was not consistent. Thus error handling has been united across all vswitches and message explicitly states the cause of the failure. NOTE: A better solution would be a refactoring of all vSwitch classes to follow VPP port handling and to move port related structures and physical port check into parent vswitch class. JIRA: VSPERF-555 Change-Id: Id09a61432ea93e261f563254829348ac61f5dc8a Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Jose Lausuch <jalausuch@suse.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
Diffstat (limited to 'vswitches/ovs_vanilla.py')
-rw-r--r--vswitches/ovs_vanilla.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/vswitches/ovs_vanilla.py b/vswitches/ovs_vanilla.py
index 942ddd41..83c52050 100644
--- a/vswitches/ovs_vanilla.py
+++ b/vswitches/ovs_vanilla.py
@@ -75,10 +75,8 @@ class OvsVanilla(IVSwitchOvs):
See IVswitch for general description
"""
if self._current_id == len(self._ports):
- self._logger.error("Can't add port! There are only " +
- len(self._ports) + " ports " +
- "defined in config!")
- raise RuntimeError('Failed to add phy port')
+ raise RuntimeError("Can't add phy port! There are only {} ports defined "
+ "by WHITELIST_NICS parameter!".format(len(self._ports)))
if not self._ports[self._current_id]:
self._logger.error("Can't detect device name for NIC %s", self._current_id)
raise ValueError("Invalid device name for %s" % self._current_id)