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 15:34:04 -0400
commit4b84887ed2322db6b04924bdee7b44d3dcf7c32d (patch)
tree7500abe13324ba298ce0b6eff08bd04f87510bd3 /lib/python/apex_python_utils.py
parentd7ceff5d5eefef27f7c2dd23c9161cc8ddd7140b (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 b6aaafaa..1f5e407c 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
@@ -192,6 +197,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