From 5d6ad9134aaffbd0cf832595e603b944e77eba7a Mon Sep 17 00:00:00 2001 From: rettenbe Date: Tue, 5 Aug 2008 16:30:04 +0000 Subject: [PATCH] bugfix: delete comment lines, function opsi_install_client still have complete functionality git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12160 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/opsi_com.pm | 96 +++++++++++++++---------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index c5d604e31..604172c20 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -638,54 +638,54 @@ sub opsi_install_client { push(@out_msg_l, $out_msg); } -# # Set parameters in opsi -# if (not $error) { -# # build return message with twisted target and source -# my $out_hash = &main::create_xml_hash("answer_$header", $target, $source); -# -# if (defined $forward_to_gosa) { -# &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa); -# } -# &add_content2xml_hash($out_hash, "hostId", "$hostId"); -# -# # Load all products for this host with status != "not_installed" or actionRequest != "none" -# if (defined $hostId){ -# my $callobj = { -# method => 'getProductStates_hash', -# params => [ $hostId ], -# id => 1, -# }; -# -# my $hres = $main::opsi_client->call($main::opsi_url, $callobj); -# if (&main::check_opsi_res($hres)){ -# my $htmp= $hres->result->{$hostId}; -# -# # check state != not_installed or action == setup -> load and add -# foreach my $product (@{$htmp}){ -# # Now we've a couple of hashes... -# if ($product->{'installationStatus'} ne "not_installed" or -# $product->{'actionRequest'} ne "none"){ -# -# # Do an action request for all these -> "setup". -# $callobj = { -# method => 'setProductActionRequest', -# params => [ $product->{'productId'}, $hostId, "setup" ], -# id => 1, -# }; -# my $res = $main::opsi_client->call($main::opsi_url, $callobj); -# if (!&main::check_opsi_res($res)){ -# &main::daemon_log("ERROR: cannot set product action request for $hostId!", 1); -# } else { -# &main::daemon_log("INFO: requesting 'setup' for '".$product->{'productId'}."' on $hostId", 1); -# } -# -# } -# } -# } -# } -# -# push(@out_msg_l, &create_xml_string($out_hash)); -# } + # Set parameters in opsi + if (not $error) { + # build return message with twisted target and source + my $out_hash = &main::create_xml_hash("answer_$header", $target, $source); + + if (defined $forward_to_gosa) { + &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa); + } + &add_content2xml_hash($out_hash, "hostId", "$hostId"); + + # Load all products for this host with status != "not_installed" or actionRequest != "none" + if (defined $hostId){ + my $callobj = { + method => 'getProductStates_hash', + params => [ $hostId ], + id => 1, + }; + + my $hres = $main::opsi_client->call($main::opsi_url, $callobj); + if (&main::check_opsi_res($hres)){ + my $htmp= $hres->result->{$hostId}; + + # check state != not_installed or action == setup -> load and add + foreach my $product (@{$htmp}){ + # Now we've a couple of hashes... + if ($product->{'installationStatus'} ne "not_installed" or + $product->{'actionRequest'} ne "none"){ + + # Do an action request for all these -> "setup". + $callobj = { + method => 'setProductActionRequest', + params => [ $product->{'productId'}, $hostId, "setup" ], + id => 1, + }; + my $res = $main::opsi_client->call($main::opsi_url, $callobj); + if (!&main::check_opsi_res($res)){ + &main::daemon_log("ERROR: cannot set product action request for $hostId!", 1); + } else { + &main::daemon_log("INFO: requesting 'setup' for '".$product->{'productId'}."' on $hostId", 1); + } + + } + } + } + } + + push(@out_msg_l, &create_xml_string($out_hash)); + } # Build wakeup message for client if (not $error) { -- 2.30.2