aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/utils.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-01-25 11:12:57 +0000
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-02-09 18:11:00 +0000
commit9dc587f166af106f7e30dbe00ddf152e9be6f1ea (patch)
treecce11bc2ce53121a118c104ceec1dd40b708def8 /yardstick/common/utils.py
parent5ad70e9e75a0061d233d1d7a786b40ea2887361c (diff)
Module to manage pip packages
This new module provides methods to manage Python PIP packages from a URL, from a local directory or from a build PIP package. The implemented commands are: - Install package. - Remove package. - List all installed packages in the system. JIRA: YARDSTICK-910 Change-Id: I8f7d1b77c0c384b801cc6f5e67d8b45ce7c6bfdf Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/common/utils.py')
-rw-r--r--yardstick/common/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py
index 8604e900f..8d6d31efb 100644
--- a/yardstick/common/utils.py
+++ b/yardstick/common/utils.py
@@ -30,6 +30,7 @@ import six
from flask import jsonify
from six.moves import configparser
from oslo_serialization import jsonutils
+from oslo_utils import encodeutils
import yardstick
@@ -105,13 +106,12 @@ def remove_file(path):
raise
-def execute_command(cmd):
+def execute_command(cmd, **kwargs):
exec_msg = "Executing command: '%s'" % cmd
logger.debug(exec_msg)
- output = subprocess.check_output(cmd.split()).split(os.linesep)
-
- return output
+ output = subprocess.check_output(cmd.split(), **kwargs)
+ return encodeutils.safe_decode(output, incoming='utf-8').split(os.linesep)
def source_env(env_file):