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) {