summaryrefslogtreecommitdiffstats
path: root/lib/python/apex/common
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-08-30 13:06:33 -0400
committerTim Rozet <trozet@redhat.com>2016-08-30 21:47:55 +0000
commitae26e2717c408225534033726614a25e16fe18ca (patch)
treec71cc3f99a03d42a8ec794337c15d10a3a3afbe8 /lib/python/apex/common
parent2eaa43854eb4abfcae8566c37cfb63f187f6696f (diff)
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 <trozet@redhat.com>
Diffstat (limited to 'lib/python/apex/common')
-rw-r--r--lib/python/apex/common/utils.py8
1 files changed, 8 insertions, 0 deletions
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