summaryrefslogtreecommitdiffstats
path: root/lib/python/apex_python_utils.py
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_python_utils.py
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_python_utils.py')
-rwxr-xr-xlib/python/apex_python_utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py
index 829b3a0f..f8cb93cc 100755
--- a/lib/python/apex_python_utils.py
+++ b/lib/python/apex_python_utils.py
@@ -7,6 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import apex
import argparse
import sys
import logging
@@ -61,6 +62,10 @@ def parse_deploy_settings(args):
settings.dump_bash()
+def run_clean(args):
+ apex.clean_nodes(args.file)
+
+
def find_ip(args):
"""
Get and print the IP from a specific interface
@@ -195,6 +200,12 @@ def get_parser():
help='path to deploy settings file')
deploy_settings.set_defaults(func=parse_deploy_settings)
+ clean = subparsers.add_parser('clean',
+ help='Parse deploy settings file')
+ clean.add_argument('-f', '--file',
+ help='path to inventory file')
+ clean.set_defaults(func=run_clean)
+
return parser