[Energy management support for P8 with CIM] support to display cim xml payload if specifying -V

This commit is contained in:
daniceexi 2014-12-23 03:02:43 -05:00
parent 06115c9cb8
commit 62b04f0d6c
2 changed files with 10 additions and 0 deletions

View File

@ -423,9 +423,17 @@ sub send_http_request
$ua->timeout(10); # the default timeout is 10s
}
if (defined($http_params->{verbose}) && defined ($http_params->{callback})) {
$http_params->{callback}({data => ["\n========CIM Request Start========", $http_request->as_string(), "=======CIM Request End======="]});
}
# send request and receive the response
my $response = $ua->request($http_request);
if (defined($http_params->{verbose}) && defined ($http_params->{callback}) && defined ($response->{_content})) {
$http_params->{callback}({data => ["\n========CIM Response Start========", $response->{_content}, "=======CIM Response End======="]});
}
# check the http response
if (defined ($response) && defined ($response->{_rc}) && defined ($response->{_msg})) {
if ($response->{_rc} eq "200" && $response->{_msg} eq "OK") {

View File

@ -382,6 +382,8 @@ sub process_request {
password => $password);
if ($verbose) {
$args{verbose} = 1;
$args{callback} = $callback;
xCAT::MsgUtils->message("I", {data => ["$node: Access hcp [$ip], user [$user], passowrd [$password]"]}, $callback);
}
# call the cim utils to connect to cim server