From ae26e2717c408225534033726614a25e16fe18ca Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Tue, 30 Aug 2016 13:06:33 -0400 Subject: Adds ability to power off nodes in clean Now if an inventory file is provided to clean, those nodes will be powered off. JIRA: APEX-250 Change-Id: I2d78285717726c3d1c9d7d88c38e706d4617e337 Signed-off-by: Tim Rozet --- lib/python/apex/common/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/python/apex/common') diff --git a/lib/python/apex/common/utils.py b/lib/python/apex/common/utils.py index b7678a20..fe34096d 100644 --- a/lib/python/apex/common/utils.py +++ b/lib/python/apex/common/utils.py @@ -7,9 +7,17 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import yaml + def str2bool(var): if isinstance(var, bool): return var else: return var.lower() in ("true", "yes") + + +def parse_yaml(yaml_file): + with open(yaml_file) as f: + parsed_dict = yaml.load(f) + return parsed_dict -- cgit 1.2.3-korg