From 09dd41b8a5b2bbae94fe54f4fbf4512037e7c75e Mon Sep 17 00:00:00 2001 From: nott Date: Thu, 28 Feb 2008 19:28:41 +0000 Subject: [PATCH] Added usage error for chdef & mkdef with -z option. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@623 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../lib/xcat/plugins/DBobjectdefs.pm | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm index cf7b58157..76d930716 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm @@ -766,6 +766,17 @@ sub defmk return 1; } + # can't have -z with other obj sources + if ($::opt_z && ($::opt_o || @::noderange)) + { + my $rsp; + $rsp->{data}->[0] = "Cannot use \'-z\' with \'-o\' or a noderange."; + $rsp->{data}->[1] = "Example of -z usage:\n\t\'cat stanzafile | mkdef -z\'\n"; + xCAT::MsgUtils->message("E", $rsp, $::callback); + &defmk_usage; + return 1; + } + # check to make sure we have a list of objects to work with if (!@::allobjnames) { @@ -1195,6 +1206,17 @@ sub defch return 1; } + # can't have -z with other obj sources + if ($::opt_z && ($::opt_o || @::noderange)) + { + my $rsp; + $rsp->{data}->[0] = "Cannot use \'-z\' with \'-o\' or a noderange."; + $rsp->{data}->[1] = "Example of -z usage:\n\t\'cat stanzafile | chdef -z\'\n"; + xCAT::MsgUtils->message("E", $rsp, $::callback); + &defch_usage; + return 1; + } + # check to make sure we have a list of objects to work with if (!@::allobjnames) {