From a89e1737d628885f6a208eac5a4d6c22327011ae Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 11 Jul 2018 16:33:46 +0100 Subject: "install_dpdk" ansible role fails if DPDK version has revision number In [1], the DPDK version string is converted to a number to be compared. If DPDK version format is "major.minor.revision", this conversion will fail. [1] https://github.com/opnfv/yardstick/blob/master/ansible/roles/install_dpdk/tasks/main.yml#L119 JIRA: YARDSTICK-1306 Change-Id: Id8d32f28627ff5a0ff8d4fb604282ba2d9931c25 Signed-off-by: Rodolfo Alonso Hernandez --- ansible/roles/install_dpdk/tasks/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml index 5bcfb50b1..f89a43cae 100644 --- a/ansible/roles/install_dpdk/tasks/main.yml +++ b/ansible/roles/install_dpdk/tasks/main.yml @@ -114,9 +114,16 @@ path: "{{ INSTALL_BIN_PATH }}" state: directory +- set_fact: + major: "{{ dpdk_version.split('.')[0] }}" + minor: "{{ dpdk_version.split('.')[1] }}" + +- set_fact: + major_minor_version: "{{ major }}.{{ minor }}" + - name: copy dpdk-devbind.py to correct location copy: - src: "{{ dpdk_devbind_usertools if dpdk_version|float >= 17.02 else dpdk_devbind_tools }}" + src: "{{ dpdk_devbind_usertools if major_minor_version|float >= 17.02 else dpdk_devbind_tools }}" dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py" remote_src: yes force: yes -- cgit 1.2.3-korg