Commit 49effc0b authored by mancini's avatar mancini

ROHD-2313: Refactor rspctlprobe.py

parent 41b108b7
......@@ -113,7 +113,8 @@ def issue_rspctl_command(cmd):
out, err = proc.communicate()
if proc.returncode == 0:
return out.decode(), err
out = list(filter(None, out.decode().split('\n')))[1:]
return out, err
else:
raise Exception("Program failed with error: \n" +
"STDOUT: %s\n" % out +
......@@ -244,7 +245,7 @@ def query_rcu_mode():
return parse_rcu_output(out, err)
# -------Subbands
def parse_subbands_output(out, err):
def parse_subbands_output(rcu_values, err):
"""
Parses the output of rspctl --subbands
......@@ -264,8 +265,6 @@ def parse_subbands_output(out, err):
:rtype: dict
"""
rcu_values = list(filter(None, out.split('\n')))[1:] # FILTERS empty strings
rcu_by_id = {}
i_row = 0
......@@ -307,7 +306,7 @@ def query_sub_bands_mode():
return parse_subbands_output(out, err)
# -------XCSub bands
def parse_xcsub_bands_output(out, err):
def parse_xcsub_bands_output(rcu_values, err):
"""
Parses the output of rspctl --xcsubbands
......@@ -344,8 +343,6 @@ def parse_xcsub_bands_output(out, err):
:rtype: dict
"""
rcu_values = list(filter(None, out.split('\n')))[1:] # it filters empty strings
rcu_by_id = {}
i_row = 0
......@@ -390,7 +387,7 @@ def query_xcsub_bands_mode():
return parse_xcsub_bands_output(out, err)
# -------Spectral inversion
def parse_spinv_output(out, err):
def parse_spinv_output(board_values, err):
"""
Parses the output of rspctl --spinv
......@@ -430,7 +427,6 @@ def parse_spinv_output(out, err):
:rtype: dict
"""
board_values = list(filter(None, out.split('\n')))[1:] # FILTERS empty strings
rcu_by_id = {}
for board_value in board_values:
temp = board_value.split(":")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment