diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2017-03-27 10:42:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-27 10:42:34 +0000 |
commit | b757c8ba94b9d8664808a39d7517a11651cc0188 (patch) | |
tree | 8278a4a0aadfcd908d13dfbd36abaa8ace630a84 /vswitches/vpp_dpdk_vhost.py | |
parent | 725033715118bc318fdd6aa3745c2c07ca714086 (diff) | |
parent | 00ae14186c5292c04766321d02fc7f82668ee066 (diff) |
Merge "vpp: Reporting update related to VPP"
Diffstat (limited to 'vswitches/vpp_dpdk_vhost.py')
-rw-r--r-- | vswitches/vpp_dpdk_vhost.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vswitches/vpp_dpdk_vhost.py b/vswitches/vpp_dpdk_vhost.py index d0d9e2ac..68375538 100644 --- a/vswitches/vpp_dpdk_vhost.py +++ b/vswitches/vpp_dpdk_vhost.py @@ -25,6 +25,7 @@ from src.dpdk import dpdk from conf import settings as S from vswitches.vswitch import IVSwitch from tools import tasks +from tools.version import Version # pylint: disable=too-many-public-methods class VppDpdkVhost(IVSwitch, tasks.Process): @@ -110,7 +111,6 @@ class VppDpdkVhost(IVSwitch, tasks.Process): self._logger.debug("VPP CLI args: %s", cli_args) return cli_args - def start(self): """Activates DPDK kernel modules and starts VPP @@ -156,6 +156,25 @@ class VppDpdkVhost(IVSwitch, tasks.Process): # has not been terminated yet tasks.Process.kill(self, signal, sleep) + def get_version(self): + """See IVswitch for general description + """ + versions = [] + output = self.run_vppctl(['show', 'version', 'verbose']) + if output[1]: + self._logger.warning("VPP version can not be read!") + return versions + + match = re.search(r'Version:\s*(.+)', output[0]) + if match: + versions.append(Version(S.getValue('VSWITCH'), match.group(1))) + + match = re.search(r'DPDK Version:\s*DPDK (.+)', output[0]) + if match: + versions.append(Version('dpdk', match.group(1))) + + return versions + def add_switch(self, switch_name, dummy_params=None): """See IVswitch for general description """ |