From 549ee35a493e45a3c827ffe4f815321386c6986c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 13 Mar 2018 11:15:18 -0400 Subject: [PATCH] Display Perl/Python for OpenBMC commands with -V --- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 +++ xCAT-server/lib/xcat/plugins/openbmc2.pm | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 41f6ed99d..5bbc34877 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -908,6 +908,9 @@ sub process_request { my $rst = parse_command_status($command, \@exargs); return if ($rst); + if ($::VERBOSE) { + xCAT::SvrUtils::sendmsg("Running command in Perl", $callback); + } if ($request->{command}->[0] ne "getopenbmccons") { $cookie_jar = HTTP::Cookies->new({}); $async = HTTP::Async->new( diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index f4c750777..61d49c733 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -47,6 +47,7 @@ my $reventlog_no_id_resolved_errormsg = "Provide a comma separated list of IDs t my %node_info = (); my $callback; +$::VERBOSE = 0; #------------------------------------------------------- @@ -92,6 +93,9 @@ sub preprocess_request { return; } + if ($::VERBOSE) { + xCAT::SvrUtils::sendmsg("Running command in Python", $callback); + } my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); foreach my $snkey (keys %$sn) { my $reqcopy = {%$request}; @@ -157,9 +161,8 @@ sub parse_args { my $noderange = shift; my $subcommand = undef; - my $verbose; unless (GetOptions( - 'V|verbose' => \$verbose, + 'V|verbose' => \$::VERBOSE, )) { return ([ 1, "Error parsing arguments." ]); }