From 4b84887ed2322db6b04924bdee7b44d3dcf7c32d 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_python_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/python/apex_python_utils.py') 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 -- cgit 1.2.3-korg