summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-03-13 23:11:49 -0400
committerGeorg Kunz <georg.kunz@ericsson.com>2018-03-14 16:02:24 +0000
commit3330fb68a80794f8df503b2956a03f57613a601a (patch)
tree0e7f60ffec39faf78925c47fe5869136f609c01d
parent66d20467c423505559bba2efa5aae2619903d647 (diff)
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 <xudan16@huawei.com>
-rw-r--r--dovetail/utils/dovetail_utils.py7
1 files 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