openbmctool_execute_command map py2/3 compatible
openbmctool_execute_command has a map command that works in py2 but
not py3. Fixed by surrounding the whole expression with list().
Change-Id: I41d078828fb923c3f53928f032ae03a86dc81369
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/openbmctool_utils.py b/lib/openbmctool_utils.py
index 2ec836b..e845f3a 100755
--- a/lib/openbmctool_utils.py
+++ b/lib/openbmctool_utils.py
@@ -76,7 +76,8 @@
# example, the user may have specified "fru status | head -n 2" which
# would be broken into 2 list elements. We will also break on ">"
# (re-direct).
- pipeline = map(str.strip, re.split(r' ([\|>]) ', str(command_string)))
+ pipeline = list(map(str.strip, re.split(r' ([\|>]) ',
+ str(command_string))))
# The "tail" command below prevents a "egrep: write error: Broken pipe"
# error if the user is piping the output to a sub-process.
# Use "egrep -v" to get rid of editorial output from openbmctool.py.