diff --git a/perl-xCAT/xCAT/PPCcli.pm b/perl-xCAT/xCAT/PPCcli.pm index 37d48b1e8..f2d65b5dc 100644 --- a/perl-xCAT/xCAT/PPCcli.pm +++ b/perl-xCAT/xCAT/PPCcli.pm @@ -1188,14 +1188,16 @@ sub network_reset { ##################################### my @eth_ip = split /,/,$current_all_ip; my $i; + my $matched = 0; for( $i=0; $i < scalar(@eth_ip); $i++) { if (@eth_ip[$i] eq $current_ip) { + $matched = 1; last; } } - if ($i >= scalar(@eth_ip)) + if ( !$matched ) { # What's happen? return ( [RC_ERROR,"No appropriate IP addresses to be updated. This could be a internal bug of xCAT."]); diff --git a/perl-xCAT/xCAT/PPCfsp.pm b/perl-xCAT/xCAT/PPCfsp.pm index 31361e608..49959217f 100644 --- a/perl-xCAT/xCAT/PPCfsp.pm +++ b/perl-xCAT/xCAT/PPCfsp.pm @@ -165,7 +165,6 @@ sub connect { # Set-Cookie: asm_session=3038839768778613290 # ################################## - if ( $res->as_string =~ /Set-Cookie: asm_session=(\d+)/ ) { ############################## # Successful logon.... @@ -1597,7 +1596,6 @@ sub netcfg my $form = undef; my $res = get_netcfg( $exp, $request, $id, \$interfaces, \$form); - return $res if ( $res->[0] == RC_ERROR); my $output = ""; @@ -1674,8 +1672,31 @@ sub get_netcfg if ( !defined( $$form )) { return( [RC_ERROR,"'Network Configuration' form not found"] ); } - } + } else { + my $data = $$form->click('submit'); + $res = $ua->request( $data); + $$form = HTML::Form->parse( $res->content, $res->base ); + if ( !defined( $$form )) { + return( [RC_ERROR,"'Network Configuration' form not found' form not found"] ); + } + if ( $$form->find_input('ip', 'radio', 1)) + { + my $ipv4Radio = $$form->find_input('ip', 'radio', 1); + if (!$ipv4Radio) + { + print "Cannot find IPv4 option\n"; + exit; + } + #$ipv4Radio->check(); + my $data = $$form->click('submit'); + $res = $ua->request( $data); + $$form = HTML::Form->parse( $res->content, $res->base ); + if ( !defined( $$form )) { + return( [RC_ERROR,"'Network Configuration' form not found"] ); + } + } + } ####################################### # Parse the form to get the inc input ####################################### diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 84eb2fbad..475a75188 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -1508,7 +1508,7 @@ sub sshcmds_on_hmc ################################ # Get userid and password ################################ - my @cred = ($target_dev->{'username'},$target_dev->{'password'}); + my @cred = ($user, $password); $request{$individual_ip}{cred} = \@cred; @exp = xCAT::PPCcli::connect( \%request, 'hmc', $individual_ip);