From b7b2a882a64fab8ba0b9f2c59e7f816af595eb77 Mon Sep 17 00:00:00 2001 From: yinle Date: Tue, 21 Jun 2011 06:42:00 +0000 Subject: [PATCH] Support mkhwconn -s with or without hmc specified. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9869 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCconn.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/PPCconn.pm b/perl-xCAT/xCAT/PPCconn.pm index 8bacac666..00ae18f08 100644 --- a/perl-xCAT/xCAT/PPCconn.pm +++ b/perl-xCAT/xCAT/PPCconn.pm @@ -55,25 +55,21 @@ sub mkhwconn_parse_args $Getopt::Long::ignorecase = 0; Getopt::Long::Configure( "bundling" ); - if ( !GetOptions( \%opt, qw(V|verbose h|help t p=s P=s port=s s) )) { + if ( !GetOptions( \%opt, qw(V|verbose h|help t p=s P=s port=s s:s) )) { return( usage() ); } return usage() if ( exists $opt{h}); -#if ( exists $opt{s} ) -#{ -# return( usage('Flags -s is just used in direct-attach enviroment.')); -#} if ( !exists $opt{t} and !exists $opt{p} and !exists $opt{s}) { return ( usage('Flag -t or -p or -s must be used.')); } - if ( exists $opt{t} and exists $opt{p}) + if (( exists $opt{t} and exists $opt{p}) or (exists $opt{s} and exists $opt{p}) or (exists $opt{t} and exists $opt{p})) { return( usage('Flags -t and -p cannot be used together.')); } - if ( exists $opt{P} and ! exists $opt{p}) + if ( exists $opt{P} and (!exists $opt{p} and !exists $opt{s})) { return( usage('Flags -P can only be used when flag -p is specified.')); } @@ -151,7 +147,7 @@ sub mkhwconn_parse_args if ( $nodetype eq 'frame') { my $my_frame_bpa_cec = xCAT::DBobjUtils::getcecchildren( $node) ; - push @frame_members, @$my_frame_bpa_cec; + push @frame_members, @$my_frame_bpa_cec if($my_frame_bpa_cec); push @frame_members, $node; } } @@ -168,7 +164,7 @@ sub mkhwconn_parse_args my $tmp_nodelist = join ',', @bpa_ctrled_nodes; return ( usage("Node(s) $tmp_nodelist is(are) controlled by BPA.")); } - + if ( scalar( @frame_members)) { my @all_nodes = xCAT::Utils::get_unique_members( @$nodes, @frame_members); @@ -426,7 +422,7 @@ sub rmhwconn_parse_args my $tmp_nodelist = join ',', @bpa_ctrled_nodes; return ( usage("Node(s) $tmp_nodelist is(are) controlled by BPA.")); } - + if ( scalar( @frame_members)) { my @all_nodes = xCAT::Utils::get_unique_members( @$nodes, @frame_members);