summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cc3c41)
raw | patch | inline | side by side (parent: 1cc3c41)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Aug 2008 12:41:45 +0000 (12:41 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Aug 2008 12:41:45 +0000 (12:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12138 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/client/events/opsi.pm | patch | blob | history |
index 128260358ae774e85c95107e8676ebf0da23ff42..82bf4f88d60b3ed6204391b67ed361d05066359f 100644 (file)
}
&add_content2xml_hash($out_hash, "hostId", "$hostId");
-# Setze alles was auf "installed" steht auf setup
-# Schaue nach produkten für diesen Host
-# Setze alle Produkte dieses Hosts auf "setup"
+ # 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 = $client->call($opsi_url, $callobj);
+ if (check_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 = $client->call($opsi_url, $callobj);
+ if (!check_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);
+ }
+
+ }
+ }
+ }
+ }
+
+
# # JSON Query
# my $callobj = {