ovs_pmd_stats: bugfix for excessive padding with ovs-vswitchd 2.14.99. 02/71602/1
authorsstrehla <slawomir.strehlau@intel.com>
Mon, 30 Nov 2020 09:34:46 +0000 (10:34 +0100)
committersstrehla <slawomir.strehlau@intel.com>
Tue, 1 Dec 2020 16:13:35 +0000 (17:13 +0100)
Added "strip" call to remove excessive whitespace padding from values
Removed trailing newline

Signed-off-by: Slawomir Strehlau <slawomir.strehlau@intel.com>
Change-Id: I49686d239fcf105a03b2fa1131a506537f2dfe13

3rd_party/ovs_pmd_stats/ovs_pmd_stats.py

index fc6045b..b706bcd 100755 (executable)
@@ -101,9 +101,8 @@ for el in array:
         plugin_instance = el[:-1].replace(' ', '_')
     else:
         type_instance = el.split(':')[0].replace(' ', "_")
-        value = el.split(':')[1].split(' ')[0]
+        value = el.split(':')[1].strip().split(' ')[0]
         print('PUTVAL %s/%s-%s/%s-%s N:%s' % (HOSTNAME, PROG_NAME, plugin_instance, TYPE, type_instance, value))
 
 # close socket
 sock.close()
-