From 3330fb68a80794f8df503b2956a03f57613a601a Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 13 Mar 2018 23:11:49 -0400 Subject: Bugfix: Failed to get the hardware info The directory of userconfig has changed from /home/opnfv/dovetail/dovetail/userconfig to /etc/dovetail/userconfig. Change-Id: Id3e8b1f3e9299e9263a4adf3456b6733fdb62e11 Signed-off-by: xudan --- dovetail/utils/dovetail_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py index be2974b6..dc7dbafb 100644 --- a/dovetail/utils/dovetail_utils.py +++ b/dovetail/utils/dovetail_utils.py @@ -21,6 +21,7 @@ from distutils.version import LooseVersion import yaml import python_hosts +from dovetail import constants from dovetail_config import DovetailConfig as dt_cfg @@ -244,9 +245,9 @@ def get_hardware_info(logger=None): if not get_inventory_file(pod_file, inventory_file, logger): logger.error("Failed to get SUT hardware info.") return None - ret, msg = exec_cmd("cd /home/opnfv/dovetail/dovetail/userconfig " - "&& ansible all -m setup -i {} --tree {}" - .format(inventory_file, info_file_path), verbose=False) + ret, msg = exec_cmd("cd {} && ansible all -m setup -i {} --tree {}" + .format(constants.USERCONF_PATH, inventory_file, + info_file_path), verbose=False) if not os.path.exists(info_file_path) or ret != 0: logger.error("Failed to get SUT hardware info.") return None -- cgit 1.2.3-korg