From 4c1bba85b91670d9e45d400bdb4bc2b6da015e1e Mon Sep 17 00:00:00 2001 From: George Kraft Date: Mon, 20 Aug 2012 12:23:14 -0500 Subject: cxmanage: Print an appropriate error message when --all-nodes fails --- scripts/cxmanage | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/cxmanage b/scripts/cxmanage index e5687f0..e04352e 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -38,6 +38,7 @@ import os import pkgutil import sys +from cxmanage import CxmanageError from cxmanage.controller import Controller # Load plugins @@ -323,8 +324,13 @@ def add_targets(controller, args, hosts=None): add_targets(controller, args, addresses) except ValueError: # Not a hostfile or IP range, add it as a regular host - controller.add_target(entry, args.user, - args.password, args.all_nodes) + try: + controller.add_target(entry, args.user, + args.password, args.all_nodes) + except CxmanageError: + print ("ERROR: Failed to retrieve IP info from %s\n" + % entry) + sys.exit(1) def power_command(controller, args): -- cgit v1.2.1