summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1766ce4)
raw | patch | inline | side by side (parent: 1766ce4)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Aug 2008 16:30:04 +0000 (16:30 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Aug 2008 16:30:04 +0000 (16:30 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12160 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/opsi_com.pm | patch | blob | history |
index c5d604e317363662690d22d9a7eaf25e71c43859..604172c20ddba127bb71a3e694b2f9c617511bf2 100644 (file)
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) {