From db9a71750e56314cb6627611aefc7f8b279d03d0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 25 Jul 2016 08:56:18 -0400 Subject: [PATCH] Fix sytax errors reported by perltidy --- perl-xCAT/xCAT/DBobjUtils.pm | 6 +- perl-xCAT/xCAT/FSPvm.pm | 8 +- perl-xCAT/xCAT/LparNetbootExp.pm | 86 ++++++++++---------- perl-xCAT/xCAT/NetworkUtils.pm | 4 +- perl-xCAT/xCAT/PPCdb.pm | 2 +- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 2 +- xCAT-UI/xcat/plugins/web.pm | 4 +- xCAT-client/bin/genimage | 6 +- xCAT-probe/lib/perl/xCAT/NetworkUtils.pm | 4 +- xCAT-rmc/scripts/mkrmcresources | 2 +- xCAT-server/lib/perl/xCAT/ADUtils.pm | 9 +- xCAT-server/lib/perl/xCAT/Template.pm | 2 +- xCAT-server/lib/xcat/monitoring/snmpmon.pm | 1 - xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 4 +- xCAT-server/lib/xcat/plugins/aixinstall.pm | 14 ++-- xCAT-server/lib/xcat/plugins/blade.pm | 18 ++-- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 2 +- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 +- xCAT-server/lib/xcat/plugins/grub2.pm | 4 +- xCAT-server/lib/xcat/plugins/imgport.pm | 4 +- xCAT-server/lib/xcat/plugins/kit.pm | 10 +-- xCAT-server/lib/xcat/plugins/kvm.pm | 23 ------ xCAT-server/lib/xcat/plugins/lsslp.pm | 2 +- xCAT-server/lib/xcat/plugins/packimage.pm | 2 +- xCAT-server/lib/xcat/plugins/petitboot.pm | 4 +- xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 2 +- xCAT-server/lib/xcat/plugins/setup.pm | 12 +-- xCAT-server/lib/xcat/plugins/snmove.pm | 2 +- xCAT-server/lib/xcat/plugins/statelite.pm | 4 +- xCAT-server/lib/xcat/plugins/tabutils.pm | 4 +- xCAT-server/lib/xcat/plugins/xen.pm | 23 ------ xCAT-server/lib/xcat/plugins/yaboot.pm | 4 +- xCAT-server/sbin/flashmic | 2 +- xCAT-server/sbin/proxydhcp-xcat | 6 +- xCAT-server/share/xcat/cons/ipmi | 2 +- xCAT-server/share/xcat/tools/mktoolscenter | 2 +- xCAT-server/share/xcat/tools/nodesw | 6 +- xCAT-server/share/xcat/tools/xcatstat | 2 +- xCAT-server/xCAT-wsapi/restapi.pl | 1 - xCAT-server/xCAT-wsapi/xcatws.cgi | 1 - xCAT-test/xcattest | 2 +- 41 files changed, 127 insertions(+), 173 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 6f9c9e3f5..5400fb7c8 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -990,7 +990,7 @@ sub setobjdefs } xCAT::MsgUtils->message("I", $rsp, $::callback); $checkedattrs{$attr_name} = 1; - if ($invalidattr->{$attr_name}->{valid} ne 1) { + if ($invalidattr->{$attr_name}->{valid} != 1) { $invalidattr->{$attr_name}->{valid} = 0; $invalidattr->{$attr_name}->{condition} = "\'$check_attr=$check_value\'"; } @@ -999,7 +999,7 @@ sub setobjdefs } if (!($objhash{$objname}{$check_attr} =~ /\b$check_value\b/) && !($DBattrvals{$objname}{$check_attr} =~ /\b$check_value\b/)) { - if ($invalidattr->{$attr_name}->{valid} ne 1) { + if ($invalidattr->{$attr_name}->{valid} != 1) { $invalidattr->{$attr_name}->{valid} = 0; $invalidattr->{$attr_name}->{condition} = "\'$check_attr=$check_value\'"; @@ -1126,7 +1126,7 @@ sub setobjdefs my $rsp; foreach my $att (keys %$invalidattr) { - if ($invalidattr->{$att}->{valid} ne 1) { + if ($invalidattr->{$att}->{valid} != 1) { my $tt = $invalidattr->{$att}->{valid}; push @{ $rsp->{data} }, "Cannot set the attr=\'$att\' attribute unless $invalidattr->{$att}->{condition}."; xCAT::MsgUtils->message("E", $rsp, $::callback); diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index c935b488b..15badd518 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -1874,11 +1874,11 @@ sub query_cec_info_actions { if (@$values[1] =~ /^$/) { next; } - if ($usage eq 1 or $usage eq 2) { + if ($usage == 1 or $usage == 2) { &parse_part_get_info(\%hash, @$values[1], $lparid); } - if ($usage eq 0 or $usage eq 2) { + if ($usage == 0 or $usage == 2) { if ($lparid) { if ($action eq "lpar_lhea_mac") { my @output = split /\n/, @$values[1]; @@ -1941,10 +1941,10 @@ sub query_cec_info_actions { push @array, [ $name, @$values[1], @$values[2] ]; } } - if ($usage eq 0 or $usage eq 2) { + if ($usage == 0 or $usage == 2) { #return $data; - if ($usage eq 2) { + if ($usage == 2) { %$lpar_hash = %hash; } return \@array; diff --git a/perl-xCAT/xCAT/LparNetbootExp.pm b/perl-xCAT/xCAT/LparNetbootExp.pm index 56a47ce34..e5f1284ac 100755 --- a/perl-xCAT/xCAT/LparNetbootExp.pm +++ b/perl-xCAT/xCAT/LparNetbootExp.pm @@ -99,12 +99,12 @@ sub nc_msg my $msg = shift; my $rsp; - if ($verbose eq 1) { + if ($verbose == 1) { $rsp->{data}->[0] = $msg; xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); } - if ($verbose eq 2) { + if ($verbose == 2) { $rsp->{data}->[0] = $msg; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); } @@ -468,7 +468,7 @@ sub get_phandle { } ], ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); # Next, the 'ls' command is sent. The result is a display of the entire # device tree. The code then looks at the @@ -552,7 +552,7 @@ sub get_phandle { } ], ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); if ($result[2] =~ /(\w*)\:(\s*)\/(\S*)/) { my $x1 = $1; @@ -698,7 +698,7 @@ sub get_adap_prop { # state 7, done $done[7] = 1; - while ($done[$state] eq 0) { + while ($done[$state] == 0) { nc_msg($verbose, "Status: command is $cmd[$state]\n"); send_command($verbose, $rconsole, $cmd[$state]); @result = (); @@ -706,7 +706,7 @@ sub get_adap_prop { $timeout, [ qr/$pattern[$state]/i, sub { - if ($state eq 1) { + if ($state == 1) { if ($rconsole->before() =~ /-\d+/) { nc_msg($verbose, "Status: Error getting adapter property for phandle=$phandle.\n"); $state = 7; @@ -750,12 +750,12 @@ sub get_adap_prop { } ] ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); # After state 3, the network type is parsed and the connector # type extracted. If the type hasn't been found, add it to # the list of supported connector types. - if ($state eq 4) { + if ($state == 4) { # Build the adapter properties from the string #regexp .*,(.*),(.*),(.*) $nw_type dummy nw_speed nw_conn nw_duplex @@ -784,7 +784,7 @@ sub get_adap_prop { # state variable is left alone. if not, the state variable is # set to 2, causing a loop back to the step where the # decode-string command is sent. - if ($state eq 5) { + if ($state == 5) { if ($result[3] =~ /2 > \.s \w+ (\w*)/) { $state = 2 if ($1 != 0); } @@ -899,14 +899,14 @@ sub get_mac_addr { # state 4, all done $done[4] = 1; - while ($done[$state] eq 0) { + while ($done[$state] == 0) { @result = (); send_command($verbose, $rconsole, $cmd[$state]); @result = $rconsole->expect( $timeout, [ qr/$pattern[$state]/ => sub { - if ($state eq 1) { + if ($state == 1) { if ($rconsole->before() =~ /-\d+/) { nc_msg($verbose, "Status: Error getting MAC address for phandle=$phandle.\n"); $rconsole->clear_accum(); @@ -990,11 +990,11 @@ sub get_mac_addr { } ], ); - return undef if ($rc eq 1); + return undef if ($rc == 1); } # if the state is 0, 1, or 2, an error occurred and the join will fail - if ($state eq 4) { + if ($state == 4) { if ($result[2] =~ /dump-mac\s*(\w*)\s*ok/) { $mac_address = $1; } @@ -1097,7 +1097,7 @@ sub get_adaptr_loc { $timeout, [ qr/$pattern[$state]/ => sub { - if ($state eq 1) { + if ($state == 1) { if ($rconsole->before() =~ /-\d+/) { nc_msg($verbose, "Status: Error getting adapter location for phandle=$phandle."); $rconsole->clear_accum(); @@ -1178,7 +1178,7 @@ sub get_adaptr_loc { } ], ); - return undef if ($rc eq 1); + return undef if ($rc == 1); } # Did we find one or more adapters? @@ -1353,7 +1353,7 @@ sub ping_server { # Get the list of properties for this adapter # $adap_prop_list_array = get_adap_prop($phandle, $rconsole, $node, $verbose); - if ($adap_prop_list_array eq 1) { + if ($adap_prop_list_array == 1) { nc_msg($verbose, "ERROR return from get_adap_prop\n"); return 1; } @@ -1444,23 +1444,23 @@ sub ping_server { ], ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); - if ($state eq 1) { + if ($state == 1) { $adap_conn = $adap_conn_list[$j]; $cmd[1] = "\" ethernet,$adap_speed,$adap_conn,$adap_duplex\" encode-string \" chosen-network-type\" property\r"; nc_msg($verbose, "Status: Trying connector type $adap_conn\n"); $j++; } - if ((($tty_do_ping eq 1) && ($state eq 4)) || ($tty_do_ping != 1) && ($state eq 3)) { + if ((($tty_do_ping == 1) && ($state == 4)) || ($tty_do_ping != 1) && ($state == 3)) { $ping_debug = $result[2]; } - if ((($tty_do_ping eq 1) && ($state eq 5)) || ($tty_do_ping != 1) && ($state eq 4)) { - if (($tty_do_ping eq 1) && ($state eq 5)) { + if ((($tty_do_ping == 1) && ($state == 5)) || ($tty_do_ping != 1) && ($state == 4)) { + if (($tty_do_ping == 1) && ($state == 5)) { #$ping_rc = $result[2]; $stack_level = length($result[4]); - } elsif (($state eq 4) && ($tty_do_ping != 1) && ($result[2] =~ /PING SUCCESS/)) { + } elsif (($state == 4) && ($tty_do_ping != 1) && ($result[2] =~ /PING SUCCESS/)) { $ping_rc = 0; #} elsif ( $result[2] =~ /unknown word/ ) { @@ -1497,7 +1497,7 @@ sub ping_server { if ($ping_rc eq 0) { nc_msg($verbose, "# $full_path_name ping successful.\n"); - } elsif ($ping_rc eq 1) { + } elsif ($ping_rc == 1) { nc_msg($verbose, "# $full_path_name ping unsuccessful.\n"); nc_msg($verbose, "# $full_path_name ping unsuccessful.\n"); nc_msg($verbose, "$ping_debug\n"); @@ -1711,7 +1711,7 @@ sub set_disk_boot { [ qr/$pattern[$state]/ => sub { $rconsole->clear_accum(); - if ($state eq 4) { + if ($state == 4) { if ($expect_out[6] eq "None") { $state = 8; } @@ -1744,7 +1744,7 @@ sub set_disk_boot { } ], ); - if ($rc eq 1) { + if ($rc == 1) { return 1; } else { return 0; @@ -1898,25 +1898,25 @@ sub boot_network { sub { $rconsole->clear_accum(); my @expect_out = shift; - if ($state eq 2) { - if ($set_boot_order eq 1) { + if ($state == 2) { + if ($set_boot_order == 1) { ######################################## # Set network as boot device ######################################## $cmd[3] = "setenv boot-device $net_device[$newstate[3]]\r"; - } elsif ($set_boot_order eq 2) { + } elsif ($set_boot_order == 2) { ######################################## # Set network as 1st boot device,disk as 2nd boot device ######################################## $boot_device_bk = $expect_out[1]; $cmd[3] = "setenv boot-device $net_device[$newstate[3]] $boot_device_bk\r"; - } elsif ($set_boot_order eq 3) { + } elsif ($set_boot_order == 3) { ######################################## # Set disk as 1st boot device,network as 2nd boot device ######################################## $boot_device_bk = $expect_out[1]; $cmd[3] = "setenv boot-device $boot_device_bk $net_device[$newstate[3]]\r"; - } elsif ($set_boot_order eq 4) { + } elsif ($set_boot_order == 4) { ######################################## # set disk as boot device ######################################## @@ -1973,7 +1973,7 @@ sub boot_network { } ], ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); } return 0; } @@ -2363,7 +2363,7 @@ sub Firmware_Dump { } ], ); - return 1 if ($rc eq 1); + return 1 if ($rc == 1); } return 0; } @@ -2846,7 +2846,7 @@ sub lparnetbootexp return [1]; } unless ($output =~ /Success/) { - if ($retry_count eq 3) { + if ($retry_count == 3) { nc_msg($verbose, "Power off failed, msg is $output.\n"); return [1]; } @@ -2874,7 +2874,7 @@ sub lparnetbootexp return [1]; } unless ($output =~ /Success/) { - if ($retry_count eq 3) { + if ($retry_count == 3) { nc_msg($verbose, "Power off failed, msg is $output.\n"); return [1]; } @@ -2988,7 +2988,7 @@ sub lparnetbootexp sub { $rconsole->send("\r"); $retry_count++; - if ($retry_count eq 9) { + if ($retry_count == 9) { nc_msg($verbose, "Timeout waiting for ok prompt; exiting.\n"); $rconsole->soft_close(); $rc = 1; @@ -3003,7 +3003,7 @@ sub lparnetbootexp } ], ); - return [1] if ($rc eq 1); + return [1] if ($rc == 1); } @@ -3033,10 +3033,10 @@ sub lparnetbootexp nc_msg($verbose, "begin to run get_phandle"); while (!$done) { my $result = get_phandle($rconsole, $node, $verbose); - if ($result eq 1) { + if ($result == 1) { $retry_count++; $rconsole->send("\r"); - if ($retry_count eq 3) { + if ($retry_count == 3) { nc_msg($verbose, "Unable to obtain network adapter information. Quitting.\n"); return [1]; } @@ -3053,7 +3053,7 @@ sub lparnetbootexp ############################## nc_msg($verbose, "begin to run multiple_open_dev"); my $result = xCAT::LparNetbootExp->multiple_open_dev($rconsole, $node, $verbose); - if ($result eq 1) { + if ($result == 1) { nc_msg($verbose, "Unable to obtain network adapter information. Quitting.\n"); return [1]; } @@ -3230,7 +3230,7 @@ sub lparnetbootexp } $mac_address = get_mac_addr($phandle_array[$i], $rconsole, $node, $verbose); if ($macaddress =~ /$mac_address/) { - if (($discovery eq 1) && !$discoverynoping) { + if (($discovery == 1) && !$discoverynoping) { unless ($adap_type[$i] eq "hfi-ent") { $ping_rc = ping_server($phandle_array[$i], $full_path_name_array[$i], $rconsole, $node, $mac_address, $verbose, $adap_speed, $adap_duplex, $list_type, $server_ip, $client_ip, $gateway_ip); } @@ -3281,7 +3281,7 @@ sub lparnetbootexp for ($i = 0 ; $i < $adapter_found ; $i++) { nc_msg($verbose, " begint to boot from first adapter in the device tree \n"); if ($adap_type[$i] eq $list_type) { - if (($discovery eq 1) && !$discoverynoping) { + if (($discovery == 1) && !$discoverynoping) { $ping_rc = ping_server($phandle_array[$i], $full_path_name_array[$i], $rconsole, $node, $mac_address, $verbose, $adap_speed, $adap_duplex, $list_type, $server_ip, $client_ip, $gateway_ip); unless ($ping_rc eq 0) { return [1]; @@ -3318,7 +3318,7 @@ sub lparnetbootexp # Need to retry network boot because of intermittant network failure # after partition reboot. Force partition to stop at Open Firmware prompt. ########################################################################### - if ($result eq 5) { + if ($result == 5) { $timeout = 300; $rconsole->expect( @@ -3360,7 +3360,7 @@ sub lparnetbootexp } ], ); - return [1] if ($rc eq 1); + return [1] if ($rc == 1); nc_msg($verbose, "# bootp sent over network.\n"); $rc = Boot($rconsole, $node, $verbose); #, @expect_out); unless ($rc eq 0) { diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index d523dc8f3..ed4694a70 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -770,7 +770,7 @@ sub classful_networks_for_net_and_mask my @results; my $bitstoeven = (8 - ($mask % 8)); - if ($bitstoeven eq 8) { $bitstoeven = 0; } + if ($bitstoeven == 8) { $bitstoeven = 0; } my $resultmask = $mask + $bitstoeven; if ($given_mask) { @@ -828,7 +828,7 @@ sub my_hexnets } (my $curnet, my $maskbits) = split /\//, $elems[2]; my $bitstoeven = (4 - ($maskbits % 4)); - if ($bitstoeven eq 4) { $bitstoeven = 0; } + if ($bitstoeven == 4) { $bitstoeven = 0; } my $padbits = (32 - ($bitstoeven + $maskbits)); my $numchars = int(($maskbits + $bitstoeven) / 4); my $curmask = 2**$maskbits - 1 << (32 - $maskbits); diff --git a/perl-xCAT/xCAT/PPCdb.pm b/perl-xCAT/xCAT/PPCdb.pm index 464ac4b34..af6eebead 100644 --- a/perl-xCAT/xCAT/PPCdb.pm +++ b/perl-xCAT/xCAT/PPCdb.pm @@ -1209,7 +1209,7 @@ sub get_host { if ($tmpmtm eq $mtm and $tmpsn eq $sn and $tmptype eq $type) { if ($oldnode =~ /^Server\-/) { #judge if need to change node's name if ($oldnode =~ /(\-A)$/) { - $nodename = s/(\-A)$//; + $nodename =~ s/(\-A)$//; # should send a warning here $$flagref = 1; diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index d65ea1cdd..dc351df6a 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1261,7 +1261,7 @@ sub check_nicips { $nic = $nic_and_ips[0]; $nic_ip = $nic_and_ips[1]; - if (exists $nics_hash{$nic} or $len ne 2) { + if (exists $nics_hash{$nic} or $len != 2) { $errmsg = "The specified nicips is incorrect. It must be formatted correctly, in the form: !,!,..."; return (1, "", $errmsg); } diff --git a/xCAT-UI/xcat/plugins/web.pm b/xCAT-UI/xcat/plugins/web.pm index c94b9c18d..cd74bde6b 100644 --- a/xCAT-UI/xcat/plugins/web.pm +++ b/xCAT-UI/xcat/plugins/web.pm @@ -1982,8 +1982,8 @@ sub web_summary { while (my ($key, $value) = each(%{$attrs})) { web_attrcount($value->[0]->{'os'}, \%oshash); web_attrcount($value->[0]->{'arch'}, \%archhash); - web_attrcount($value->[0]->{'provmethod'},, \%provhash); - web_attrcount($value->[0]->{'nodetype'},, \%typehash); + web_attrcount($value->[0]->{'provmethod'}, \%provhash); + web_attrcount($value->[0]->{'nodetype'}, \%typehash); } $attrs = $nodelistTab->getNodesAttribs(\@nodes, ['status']); diff --git a/xCAT-client/bin/genimage b/xCAT-client/bin/genimage index 4693a56e2..d09119dc5 100755 --- a/xCAT-client/bin/genimage +++ b/xCAT-client/bin/genimage @@ -182,7 +182,7 @@ if ((!$imagename) && (!$os)) { } } - if ($#oses eq -1) { + if ($#oses == -1) { print "There are no OS repositories in $installdir. Please run copycds for the OS first.\n"; exit 1; } @@ -260,7 +260,7 @@ if ((!$imagename) && (!$profile)) { $seen{$f}++; } @profiles = sort keys %seen; - if ($#profiles eq -1) { + if ($#profiles == -1) { print "There are no profiles in $::XCATROOT/share/xcat/netboot/$osfamily.\n"; exit 1; } @@ -287,7 +287,7 @@ if ((!$imagename) && (!$profile)) { $match = 1; } } - if ($match eq 1) { + if ($match == 1) { last; } } diff --git a/xCAT-probe/lib/perl/xCAT/NetworkUtils.pm b/xCAT-probe/lib/perl/xCAT/NetworkUtils.pm index d523dc8f3..ed4694a70 100644 --- a/xCAT-probe/lib/perl/xCAT/NetworkUtils.pm +++ b/xCAT-probe/lib/perl/xCAT/NetworkUtils.pm @@ -770,7 +770,7 @@ sub classful_networks_for_net_and_mask my @results; my $bitstoeven = (8 - ($mask % 8)); - if ($bitstoeven eq 8) { $bitstoeven = 0; } + if ($bitstoeven == 8) { $bitstoeven = 0; } my $resultmask = $mask + $bitstoeven; if ($given_mask) { @@ -828,7 +828,7 @@ sub my_hexnets } (my $curnet, my $maskbits) = split /\//, $elems[2]; my $bitstoeven = (4 - ($maskbits % 4)); - if ($bitstoeven eq 4) { $bitstoeven = 0; } + if ($bitstoeven == 4) { $bitstoeven = 0; } my $padbits = (32 - ($bitstoeven + $maskbits)); my $numchars = int(($maskbits + $bitstoeven) / 4); my $curmask = 2**$maskbits - 1 << (32 - $maskbits); diff --git a/xCAT-rmc/scripts/mkrmcresources b/xCAT-rmc/scripts/mkrmcresources index 261b67cd6..98466a551 100755 --- a/xCAT-rmc/scripts/mkrmcresources +++ b/xCAT-rmc/scripts/mkrmcresources @@ -826,7 +826,7 @@ if ( } if ($::HELP) { &usage; exit; } -if (isHMC() && ($ENV{'DC_ENVIRONMENT'} ne 1)) +if (isHMC() && ($ENV{'DC_ENVIRONMENT'} != 1)) { print "mkresources is not supported on HMC.\n"; } diff --git a/xCAT-server/lib/perl/xCAT/ADUtils.pm b/xCAT-server/lib/perl/xCAT/ADUtils.pm index 50db9005f..cdd095f6f 100644 --- a/xCAT-server/lib/perl/xCAT/ADUtils.pm +++ b/xCAT-server/lib/perl/xCAT/ADUtils.pm @@ -364,8 +364,10 @@ sub delete_user_account { #provide enough data to construct an /etc/passwd looki } } -=cut +=head3 add_user_account + example: add_user_account(username=>'fred',fullname=>'fred the great'); + =cut sub add_user_account { @@ -479,10 +481,11 @@ sub add_user_account { return { password => $newpassword }; } -=cut -add_host_account +=head3 add_host_account + Arguments are in a hash: node=>name of machine to add + =cut sub add_host_account { diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index a80402fd1..41511ef3e 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -670,7 +670,7 @@ sub windows_net_cfg { } $interface_cfg .= '' . $ip . "/$netmask" . ''; } - if ($num eq 1) { + if ($num == 1) { # no correct IP with correct network is found next; diff --git a/xCAT-server/lib/xcat/monitoring/snmpmon.pm b/xCAT-server/lib/xcat/monitoring/snmpmon.pm index 8b24f282e..1a7cf4d4d 100644 --- a/xCAT-server/lib/xcat/monitoring/snmpmon.pm +++ b/xCAT-server/lib/xcat/monitoring/snmpmon.pm @@ -417,7 +417,6 @@ sub deconfig { (return code, message) =cut -=cut #-------------------------------------------------------------------------------- sub deconfigSNMP { return (0, ""); diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index b9db2a539..6e55d0944 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -406,7 +406,7 @@ sub processArgs } } if (defined($::args) && @{$::args}) { - if (scalar(@{$::args}) eq 1 and $::args->[0] eq '-S') + if (scalar(@{$::args}) == 1 and $::args->[0] eq '-S') { if ($::command eq "lsdef") { push @ARGV, "-t"; @@ -3649,7 +3649,7 @@ sub defls my @def_nodes = keys %defhash; my $hidden_nodes = $listtab->getNodesAttribs(\@def_nodes, ['hidden']); foreach my $n (keys %{$hidden_nodes}) { - if (defined($hidden_nodes->{$n}->[0]->{'hidden'}) && $hidden_nodes->{$n}->[0]->{'hidden'} eq 1) { + if (defined($hidden_nodes->{$n}->[0]->{'hidden'}) && $hidden_nodes->{$n}->[0]->{'hidden'} == 1) { delete $defhash{$n}; } } diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index 969bae7a2..4208109fe 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -5175,7 +5175,7 @@ sub chk_resolv_conf last; } } - if (!$nfsvers || ($nfsvers eq 3)) + if (!$nfsvers || ($nfsvers == 3)) { my $ecmd = qq~/usr/sbin/rmnfsexp -d $install_dir/nim/resolv_conf/$resolv_conf_name/resolv.conf -B 2>/dev/null~; xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $nimprime, $ecmd, 0); @@ -7426,7 +7426,7 @@ sub updatespot chomp $sharedinstall; if ($sharedinstall eq "sns") { my $rc = xCAT::InstUtils->dolitesetup($image, \%imghash, \@nodelist, $callback, $subreq); - if ($rc eq 1) { # error + if ($rc == 1) { # error my $rsp; push @{ $rsp->{data} }, qq{Could not complete the statelite setup.}; xCAT::MsgUtils->message("E", $rsp, $callback); @@ -8796,7 +8796,7 @@ qq~mkdir -m 644 -p $install_dir/nim/scripts; cp $install_dir/postscripts/xcataix last; } } - if (!$nfsvers || ($nfsvers eq 3)) + if (!$nfsvers || ($nfsvers == 3)) { # make sure we clean up the /etc/exports file of NFSv3 exports my $ecmd = qq~/usr/sbin/rmnfsexp -d $install_dir/nim/scripts/xcataixscript -B 2>/dev/null~; @@ -11260,7 +11260,7 @@ sub mkdsklsnode } my $rc = xCAT::InstUtils->dolitesetup($image, \%imagehash, \@osinodes, $callback, $subreq); - if ($rc eq 1) { # error + if ($rc == 1) { # error my $rsp; push @{ $rsp->{data} }, qq{Could not complete the statelite setup.}; xCAT::MsgUtils->message("E", $rsp, $callback); @@ -12405,7 +12405,7 @@ sub mkdsklsnode my $xcatmaster = $objhash{$tnode}{'xcatmaster'}; $xcatmasterhash{$xcatmaster} = 1; } - if (scalar(keys %snhash) ne 2) + if (scalar(keys %snhash) != 2) { $setuphanfserr++; my $rsp; @@ -12414,7 +12414,7 @@ sub mkdsklsnode xCAT::MsgUtils->message("E", $rsp, $callback); } - if (scalar(keys %xcatmasterhash) ne 1) + if (scalar(keys %xcatmasterhash) != 1) { my %masteriphash = (); foreach my $master (keys %xcatmasterhash) @@ -12422,7 +12422,7 @@ sub mkdsklsnode my $xcatmasterip = xCAT::NetworkUtils->getipaddr($master); $masteriphash{$xcatmasterip} = 1; } - if (scalar(keys %masteriphash) ne 1) + if (scalar(keys %masteriphash) != 1) { $setuphanfserr++; my $rsp; diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 1a751bfa6..7ff063a48 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -292,7 +292,7 @@ sub isallchassis { } foreach (1 .. 14) { my $tmp = $session->get([ $bladexistsoid . ".$_" ]); - if ($tmp eq 1) { $bladesinchassis++ } + if ($tmp == 1) { $bladesinchassis++ } } my $count = keys %{ $mpahash{$mpa}->{nodes} }; if ($count >= $bladesinchassis) { $allinchassis++; return 1 }; #commands that affect entire are okayed, i.e eventlog clear @@ -498,7 +498,7 @@ m/Severity:(\S+)\s+Source:(\S+)\s+Name:\S*\s+Date:(\S+)\s+Time:(\S+)\s+Text:(.+) $data = $session->set($varbind); if ($session->{ErrorStr}) { return (1, $session->{ErrorStr}); } $didchassis = 1; - if ($varbind->[2] eq 1) { + if ($varbind->[2] == 1) { return 0, "eventlog cleared"; } } @@ -1001,7 +1001,7 @@ sub vitals { if (grep /temp/, @vitems) { for my $idx (6 .. 20) { - if ($idx eq 11) { + if ($idx == 11) { next; } push @bindlist, [ ".1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.$idx", $slot ]; @@ -1429,14 +1429,14 @@ sub populateblowervitals { my $idx = $_->[1]; my $tmp_type = $_->[0]; $tmp_type =~ s/^.*\.(\d*)$/$1/; - if ($tmp_type eq 3) { + if ($tmp_type == 3) { $blowerstats{$idx}->{percentage} = $_->[2]; $blowerstats{$idx}->{percentage} =~ s/^(\d*)%.*$/$1/; - } elsif ($tmp_type eq 4) { + } elsif ($tmp_type == 4) { $blowerstats{$idx}->{state} = $_->[2]; - } elsif ($tmp_type eq 5) { + } elsif ($tmp_type == 5) { $blowerstats{$idx}->{rpm} = $_->[2]; - } elsif ($tmp_type eq 6) { + } elsif ($tmp_type == 6) { $blowerstats{$idx}->{cstate} = $_->[2]; } } @@ -1525,7 +1525,7 @@ sub rscan { foreach (1 .. 14) { my $tmp = $session->get([ $bladexistsoid . ".$_" ]); - if ($tmp eq 1) { + if ($tmp == 1) { my $type = $session->get([ $blademtmoid, $_ ]); if ($session->{ErrorStr}) { return (1, $session->{ErrorStr}); @@ -3779,7 +3779,7 @@ sub bladecmd { if ($slot > 0 and not $slot =~ /:/) { my $tmp = $session->get([ $bladexistsoid . ".$slot" ]); if ($session->{ErrorStr}) { return (1, $session->{ErrorStr}); } - unless ($tmp eq 1) { return (1, "Target bay empty"); } + unless ($tmp == 1) { return (1, "Target bay empty"); } } if ($command eq "rbeacon") { return beacon(@args); diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 6fac9950a..608bc9092 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -82,7 +82,7 @@ sub process_request return 2; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { return 2; } diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 66a51a003..ed84bfae6 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -537,7 +537,7 @@ sub addnode unless ($node_server) { my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($node); unless ($nxtsrvd[0]) { $nxtsrv = $nxtsrvd[1]; } - elsif ($nxtsrvd[0] eq 1) { $callback->({ error => [ $nxtsrvd[1] ] }); } + elsif ($nxtsrvd[0] == 1) { $callback->({ error => [ $nxtsrvd[1] ] }); } else { $callback->({ error => ["Unable to determine the tftpserver for $node"], errorcode => [1] }); return; diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 67a352df2..d315ad241 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -107,7 +107,7 @@ sub setstate { my $ipfn; my @ipfnd = xCAT::NetworkUtils->my_ip_facing($node); - if ($ipfnd[0] eq 1) { + if ($ipfnd[0] == 1) { $::callback->( { error => [ $ipfnd[1] ], @@ -115,7 +115,7 @@ sub setstate { }); return; } - elsif ($ipfnd[0] eq 2) { + elsif ($ipfnd[0] == 2) { my $servicenodes = $nrhash{$node}->[0]; if ($servicenodes and $servicenodes->{servicenode}) { my @sns = split /,/, $servicenodes->{servicenode}; diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index 7ba19c3e9..d594385af 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -110,7 +110,7 @@ sub ximport { }; unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } @@ -157,7 +157,7 @@ sub xexport { }; unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index e3a4d362e..bdc12da42 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -1172,7 +1172,7 @@ sub addkit unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } @@ -1508,7 +1508,7 @@ sub rmkit unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } @@ -1929,7 +1929,7 @@ sub addkitcomp unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } @@ -2481,7 +2481,7 @@ sub rmkitcomp unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } @@ -3403,7 +3403,7 @@ sub chkkitcomp unless (defined($request->{arg})) { $xusage->(1); return; } @ARGV = @{ $request->{arg} }; - if ($#ARGV eq -1) { + if ($#ARGV == -1) { $xusage->(1); return; } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index e97c0669f..f4fe987e9 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3425,29 +3425,6 @@ sub guestcmd { return rscan($node, @args); } -=cut - } elsif ($command eq "rvitals") { - return vitals(@args); - } elsif ($command =~ /r[ms]preset/) { - return resetmp(@args); - } elsif ($command eq "rspconfig") { - return mpaconfig($mpa,$user,$pass,$node,$slot,@args); - } elsif ($command eq "rbootseq") { - return bootseq(@args); - } elsif ($command eq "switchblade") { - return switchblade(@args); - } elsif ($command eq "getmacs") { - return getmacs(@args); - } elsif ($command eq "rinv") { - return inv(@args); - } elsif ($command eq "reventlog") { - return eventlog(@args); - } elsif ($command eq "rscan") { - return rscan(\@args); - } - -=cut - return (1, "$command not a supported command by kvm method"); } diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index 6f9111680..369b41867 100755 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -290,7 +290,7 @@ sub parse_args { ############################################# # Check for node range ############################################# - if (scalar(@ARGV) eq 1) { + if (scalar(@ARGV) == 1) { my @nodes = xCAT::NodeRange::noderange(@ARGV); foreach (@nodes) { push @filternodes, $_; diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 3032615f6..3ed8d5f35 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -701,7 +701,7 @@ sub parseLiteFiles { my @res = grep { $_ =~ m/\Q$parent\E$/ } @entries; my $found = scalar @res; - if ($found eq 1) { # $parent is found in @entries + if ($found == 1) { # $parent is found in @entries # handle $res[0]; my @tmpresentry = split /\s+/, $res[0]; shift @tmpresentry; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 957c09388..3d3d7fa6d 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -108,7 +108,7 @@ sub setstate { my $ipfn; my @ipfnd = xCAT::NetworkUtils->my_ip_facing($node); - if ($ipfnd[0] eq 1) { + if ($ipfnd[0] == 1) { $::callback->( { error => [ $ipfnd[1] ], @@ -116,7 +116,7 @@ sub setstate { }); return; } - elsif ($ipfnd[0] eq 2) { + elsif ($ipfnd[0] == 2) { my $servicenodes = $nrhash{$node}->[0]; if ($servicenodes and $servicenodes->{servicenode}) { my @sns = split /,/, $servicenodes->{servicenode}; diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index abe8b834a..fc668a0af 100755 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -919,7 +919,7 @@ Usage: } if (@discoverednodes) { unless ($long) { - push @{ $rsp->{data} }, sprintf(" %-40s%-20s%-15s%-10s%-13s", 'UUID', 'NODE',, 'METHOD', 'MTM', 'SERIAL'); + push @{ $rsp->{data} }, sprintf(" %-40s%-20s%-15s%-10s%-13s", 'UUID', 'NODE', 'METHOD', 'MTM', 'SERIAL'); } foreach (@discoverednodes) { push @{ $rsp->{data} }, "$_"; diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index d249af6ee..5ebe50cd9 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -490,8 +490,8 @@ sub writeframe { my $num1 = int((int($num) - $fnum) / $framesperhmc) + $umb; my $num2 = length($$hmchash{'primary-start'}) - length($num1); $FRAMESFP{$nn}{sfp} = $hmcbase . $num1 . $hmcattch if ($num2 <= 0); - $FRAMESFP{$nn}{sfp} = $hmcbase . '0' . $num1 . $hmcattch if ($num2 eq 1); - $FRAMESFP{$nn}{sfp} = $hmcbase . '00' . $num1 . $hmcattch if ($num2 eq 2); + $FRAMESFP{$nn}{sfp} = $hmcbase . '0' . $num1 . $hmcattch if ($num2 == 1); + $FRAMESFP{$nn}{sfp} = $hmcbase . '00' . $num1 . $hmcattch if ($num2 == 2); } $tables{'ppc'}->setNodesAttribs(\%FRAMESFP); } @@ -533,10 +533,10 @@ sub writechildren { } else { $trange = 1; } - $ranges{'A-0'} = $trange if ($tt eq 0); - $ranges{'A-1'} = $trange if ($tt eq 1); - $ranges{'B-0'} = $trange if ($tt eq 2); - $ranges{'B-1'} = $trange if ($tt eq 3); + $ranges{'A-0'} = $trange if ($tt == 0); + $ranges{'A-1'} = $trange if ($tt == 1); + $ranges{'B-0'} = $trange if ($tt == 2); + $ranges{'B-1'} = $trange if ($tt == 3); $tt++; } if ($DELETENODES) { diff --git a/xCAT-server/lib/xcat/plugins/snmove.pm b/xCAT-server/lib/xcat/plugins/snmove.pm index 2c8506c60..90665f453 100644 --- a/xCAT-server/lib/xcat/plugins/snmove.pm +++ b/xCAT-server/lib/xcat/plugins/snmove.pm @@ -2227,7 +2227,7 @@ sub sfsSLconfig # dolitesetup to update the shared_root table files # - updates files in the sopot and shared_root resour my $rc = xCAT::InstUtils->dolitesetup($i, \%imghash, \@{ $osinodes{$i} }, $callback, $sub_req); - if ($rc eq 1) { # error + if ($rc == 1) { # error my $rsp; push @{ $rsp->{data} }, "Could not complete the statelite setup.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 866262816..9435e390d 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -719,11 +719,11 @@ sub parseLiteFiles { $parent .= "/" unless ($parent =~ m/\/$/); @res = grep { $_ =~ m/\Q$parent\E$/ } @entries; $found = scalar @res; - last if ($found eq 1); + last if ($found == 1); $parent = dirname $parent; } - if ($found eq 1) { # $parent is found in @entries + if ($found == 1) { # $parent is found in @entries # handle $res[0]; my @tmpresentry = split /\s+/, $res[0]; shift @tmpresentry; # remove the imgname in @tmpresentry diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 28d0b261b..0515eae93 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1947,7 +1947,7 @@ sub nodels foreach my $rnode (@$nodes) { unless (defined($listHash->{$rnode}->[0]->{hidden})) { push(@newnodes, $rnode); - } elsif ($listHash->{$rnode}->[0]->{hidden} ne 1) { + } elsif ($listHash->{$rnode}->[0]->{hidden} != 1) { push(@newnodes, $rnode); } } @@ -2181,7 +2181,7 @@ sub nodels foreach my $rnode (@nodes) { unless (defined($listHash->{$rnode}->[0]->{hidden})) { push(@newnodes, $rnode); - } elsif ($listHash->{$rnode}->[0]->{hidden} ne 1) { + } elsif ($listHash->{$rnode}->[0]->{hidden} != 1) { push(@newnodes, $rnode); } } diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 2721d6139..9d9289e18 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -586,29 +586,6 @@ sub guestcmd { return getvmcons($node, @args); } -=cut - } elsif ($command eq "rvitals") { - return vitals(@args); - } elsif ($command =~ /r[ms]preset/) { - return resetmp(@args); - } elsif ($command eq "rspconfig") { - return mpaconfig($mpa,$user,$pass,$node,$slot,@args); - } elsif ($command eq "rbootseq") { - return bootseq(@args); - } elsif ($command eq "switchblade") { - return switchblade(@args); - } elsif ($command eq "getmacs") { - return getmacs(@args); - } elsif ($command eq "rinv") { - return inv(@args); - } elsif ($command eq "reventlog") { - return eventlog(@args); - } elsif ($command eq "rscan") { - return rscan(\@args); - } - -=cut - return (1, "$command not a supported command by xen method"); } diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 60bf8b408..a1bde29f0 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -100,7 +100,7 @@ sub setstate { my $ipfn; my @ipfnd = xCAT::NetworkUtils->my_ip_facing($node); - if ($ipfnd[0] eq 1) { + if ($ipfnd[0] == 1) { $::YABOOT_callback->( { error => [ $ipfnd[1] ], @@ -108,7 +108,7 @@ sub setstate { }); return; } - elsif ($ipfnd[0] eq 2) { + elsif ($ipfnd[0] == 2) { my $servicenodes = $nrhash{$node}->[0]; if ($servicenodes and $servicenodes->{servicenode}) { my @sns = split /,/, $servicenodes->{servicenode}; diff --git a/xCAT-server/sbin/flashmic b/xCAT-server/sbin/flashmic index 0a92fd94d..c782feb54 100755 --- a/xCAT-server/sbin/flashmic +++ b/xCAT-server/sbin/flashmic @@ -171,7 +171,7 @@ foreach (@$output) { if ($line =~ /^mic(\d+):/) { $line =~ s/^mic(\d+):/MICMSG:$miccfg{$1}{'name'}:/; } - print $line. "\n"; + print $line . "\n"; } } diff --git a/xCAT-server/sbin/proxydhcp-xcat b/xCAT-server/sbin/proxydhcp-xcat index 8fba00534..f3c9ea297 100755 --- a/xCAT-server/sbin/proxydhcp-xcat +++ b/xCAT-server/sbin/proxydhcp-xcat @@ -127,7 +127,7 @@ until ($quit) { my $strp = 0xf0; my $archp = 0; while ($strp < $#package) { - if ($package[$strp] eq 60) { + if ($package[$strp] == 60) { $archp = $strp + 0x11; last; } else { @@ -240,12 +240,12 @@ until ($quit) { } if (($num - 5) % 16 eq 0) { syslog("info", $msg); - print $msg. "\n"; + print "$msg \n"; $msg = ""; } $num++; } - print $msg. "\n"; + print "$msg \n"; } } diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index 875fa11ba..620a72e01 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -54,7 +54,7 @@ sub getans { $password = $rsp->{node}->[0]->{bmcpass}->[0]; if (exists $rsp->{node}->[0]->{error}) { my $error = $rsp->{node}->[0]->{error}->[0]; - print $error. "\n"; + print "$error\n"; } } } diff --git a/xCAT-server/share/xcat/tools/mktoolscenter b/xCAT-server/share/xcat/tools/mktoolscenter index 8766890c7..8ec88ebc8 100755 --- a/xCAT-server/share/xcat/tools/mktoolscenter +++ b/xCAT-server/share/xcat/tools/mktoolscenter @@ -574,7 +574,7 @@ if (symlink($repo, "$path/repo") eq 0) { exit; } -if ($surrogate eq 1) { +if ($surrogate == 1) { output("Creating tar"); my $tarme = ""; if (-d "$instroot/netboot/toolscenter") { diff --git a/xCAT-server/share/xcat/tools/nodesw b/xCAT-server/share/xcat/tools/nodesw index 4a3db0f4a..a3fc4c08a 100755 --- a/xCAT-server/share/xcat/tools/nodesw +++ b/xCAT-server/share/xcat/tools/nodesw @@ -35,7 +35,7 @@ sub getVlanMask { #foreach (@xs){ # print $_ . "\n"; #} - unless (scalar(@xs) eq 7) { + unless (scalar(@xs) == 7) { print "Could not get vlan mask for $vlan\n"; } @@ -121,7 +121,7 @@ sub connectToSwitch { #ERROR: print "Failed to communicate with $switch\n"; - print $SNMP::Session::ErrorStr . "\n"; + print "$SNMP::Session::ErrorStr\n"; #xCAT::MsgUtils->message("S","Failed to communicate with $switch"); } @@ -259,7 +259,7 @@ sub addNodeToVlan { #print Dumper($v2); $session->set($v2); if ($session->{ErrorStr}) { - print "Error! " . $session->{ErrorStr} . "\n"; + print "Error! $session->{ErrorStr} \n"; } ####################################### diff --git a/xCAT-server/share/xcat/tools/xcatstat b/xCAT-server/share/xcat/tools/xcatstat index 32e84b733..46a460766 100755 --- a/xCAT-server/share/xcat/tools/xcatstat +++ b/xCAT-server/share/xcat/tools/xcatstat @@ -178,7 +178,7 @@ if ($DILIMITER) { print "# Hostname:Status:Network-Interfaces:\n"; foreach (sort @statusoutput) { - print $_. ":\n"; + print "$_ :\n"; } exit 0; diff --git a/xCAT-server/xCAT-wsapi/restapi.pl b/xCAT-server/xCAT-wsapi/restapi.pl index 716cff310..a4427e8d0 100755 --- a/xCAT-server/xCAT-wsapi/restapi.pl +++ b/xCAT-server/xCAT-wsapi/restapi.pl @@ -1347,7 +1347,6 @@ else { sub isGET { return uc($requestType) eq "GET"; } sub isPost { return uc($requestType) eq "POST"; } sub isPut { return uc($requestType) eq "PUT"; } -sub isPost { return uc($requestType) eq "POST"; } sub isPatch { return uc($requestType) eq "PATCH"; } sub isDelete { return uc($requestType) eq "DELETE"; } diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 30a04cecc..cc911b2bf 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -1524,7 +1524,6 @@ else { sub isGET { return uc($requestType) eq "GET"; } sub isPost { return uc($requestType) eq "POST"; } sub isPut { return uc($requestType) eq "PUT"; } -sub isPost { return uc($requestType) eq "POST"; } sub isPatch { return uc($requestType) eq "PATCH"; } sub isDelete { return uc($requestType) eq "DELETE"; } diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 871da212f..3523c04e6 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -444,7 +444,7 @@ sub Get_Files_Recursive } else { my $dirpath = $dir . '/' . $direntry . "\n"; - print $dir. '/' . $direntry . "\n"; + print $dirpath; #print $dir."\n"; push(@filespath, glob("$dirpath"));