From 2c1c3111fd2eb39175a3f36122527ec154e85dd8 Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Thu, 23 Jul 2020 16:48:06 +0530 Subject: [Libfix] Remove get_gluster_version() checks Problem: When run for nightly gluster builds dht cases fails with below traceback: ``` def get_gluster_version(host): """Checks the gluster version on the nodes Args: host(str): IP of the host whose gluster version has to be checked. Returns: (float): The gluster version value. """ command = 'gluster --version' _, out, _ = g.run(host, command) g.log.info("The Gluster verion of the cluster under test is %s", out) > return float(out.split(' ')[1]) E ValueError: could not convert string to float: '20200719.9334a8d\nRepository ``` This is due to nightly builds returning the below output: ``` $ gluster --version glusterfs 20200708.cdf01cc Repository revision: git://git.gluster.org/glusterfs.git Copyright (c) 2006-2016 Red Hat, Inc. GlusterFS comes with ABSOLUTELY NO WARRANTY. It is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. ``` Instead of: ``` $ gluster --version glusterfs 6.0 ``` This is caused as while building the we use `VERSION="${GIT_DATE}.${GIT_HASH}` which causes the version API to return new output. Solution: Remove the checks and modify the function to return string instead of float. Fixes: https://github.com/gluster/glusto-tests/issues/22 Change-Id: I2e889bd0354a1aa75de25aedf8b14eb5ff5ecbe6 Signed-off-by: kshithijiyer --- glustolibs-gluster/glustolibs/gluster/gluster_init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glustolibs-gluster/glustolibs/gluster/gluster_init.py') diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_init.py b/glustolibs-gluster/glustolibs/gluster/gluster_init.py index fd8f174ed..d6740b773 100644 --- a/glustolibs-gluster/glustolibs/gluster/gluster_init.py +++ b/glustolibs-gluster/glustolibs/gluster/gluster_init.py @@ -290,10 +290,10 @@ def get_gluster_version(host): host(str): IP of the host whose gluster version has to be checked. Returns: - (float): The gluster version value. + str: The gluster version value. """ command = 'gluster --version' _, out, _ = g.run(host, command) g.log.info("The Gluster verion of the cluster under test is %s", out) - return float(out.split(' ')[1]) + return out.split(' ')[1] -- cgit