From e4619859c0906bf32c63931da5b4beeee6e77502 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Apr 2021 13:13:27 -0400 Subject: [PATCH] Use correct Perl string compare operator --- xCAT-client/bin/mysqlsetup | 4 ++-- xCAT-probe/subcmds/xcatmn | 10 +++++----- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 588db7011..48a15f8d3 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -152,7 +152,7 @@ $::linuxos = xCAT::Utils->osver(); my $sp1flag; # if linuxos==sles12 -if ($::linuxos == "sles12") { +if ($::linuxos eq "sles12") { # open /etc/os-release my @lines; @@ -930,7 +930,7 @@ sub initmysqldb $cmd = "$sqlcmd --user=mysql"; #on rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip, #but it's available at the /usr/bin/resolveip - if ($::linuxos == "rhels7.7") { + if ($::linuxos eq "rhels7.7") { my $resolveip="/usr/libexec/resolveip"; if (!(-x ($resolveip))) { my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index f2f6ed1da..099bc4dcb 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -62,7 +62,7 @@ sub do_main_job { #check if all xcat daemons are running ($rst, $flag) = check_all_xcat_daemons(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); return $rst if ($rst); #check if xcatd can receive request @@ -89,13 +89,13 @@ sub do_main_job { #check important directory ($rst, $flag) = check_directory(\%sitetable, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check if SElinux is disabled ($rst, $flag) = check_selinux(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check http service @@ -106,7 +106,7 @@ sub do_main_job { #check tftp service ($rst, $flag) = check_tftp_service($installnicip, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check DNS service @@ -310,7 +310,7 @@ sub check_all_xcat_daemons { foreach my $daemon (@daemon_list) { my $counter = $output =~ s/$daemon/$daemon/g; if ($counter > 1) { - if ($daemon == "SSL listener") { + if ($daemon eq "SSL listener") { my $cur_pid = `cat /var/run/xcatd.pid`; my @ssl_pids = `ps aux 2>&1|grep -v grep|grep "xcatd: $daemon"|awk -F' ' '{print \$2}'`; foreach my $ssl_pid (@ssl_pids) { diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 456a8b802..19076b962 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1496,7 +1496,7 @@ sub parse_args { # Updateid was passed, check flags allowed with update id if ($option_flag !~ /^--delete$|^-a$|^--activate$/) { my $optional_help_msg = ""; - if ($option_flag == "-d") { + if ($option_flag eq "-d") { # For this special case, -d was changed to pass in a directory. $optional_help_msg = "Did you mean --delete?" }