From 6b48f2070408b3b9898dd3bd53921c831b245222 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 27 Oct 2008 10:29:08 +0000 Subject: [PATCH] * delete debug lines for opsi_get_netboot_product problem * add function opsi_client2string to GosaSupportDaemon.pm git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12778 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/modules/GosaSupportDaemon.pm | 15 +++++++++++++++ gosa-si/server/events/opsi_com.pm | 8 ++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index 65bea486a..2e971370a 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -35,6 +35,7 @@ my @functions = ( "read_configfile", "check_opsi_res", "calc_timestamp", + "opsi_callobj2string", ); @EXPORT = @functions; use strict; @@ -861,5 +862,19 @@ sub calc_timestamp { return $res_timestamp; } +sub opsi_callobj2string { + my ($callobj) = @_; + my @callobj_string; + while(my ($key, $value) = each(%$callobj)) { + my $value_string = ""; + if (ref($value) eq "ARRAY") { + $value_string = join(",", @$value); + } else { + $value_string = $value; + } + push(@callobj_string, "$key=$value_string") + } + return join(", ", @callobj_string); +} 1; diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index 80a589947..e1fd6486f 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -405,7 +405,6 @@ sub opsi_get_netboot_products { my $hostId; my $xml_msg; -&main::daemon_log("\n================================== 0", 1); # Build return message with twisted target and source my $out_hash = &main::create_xml_hash("answer_$header", $main::server_address, $source); if (defined $forward_to_gosa) { @@ -420,7 +419,6 @@ sub opsi_get_netboot_products { &add_content2xml_hash($out_hash, "xxx", ""); $xml_msg = &create_xml_string($out_hash); -&main::daemon_log("\n================================== 1", 1); # For hosts, only return the products that are or get installed my $callobj; $callobj = { @@ -429,16 +427,16 @@ sub opsi_get_netboot_products { id => 1, }; + &main::daemon_log("$session_id DEBUG: send callobj to opsi_client: ".&opsi_callobj2string($callobj), 7); my $res = $main::opsi_client->call($main::opsi_url, $callobj); + &main::daemon_log("$session_id DEBUG: get answer from opsi_client with number of entries: ".length(@$res), 7); my %r = (); for (@{$res->result}) { $r{$_} = 1 } -&main::daemon_log("\n================================== 2", 1); if (not &check_opsi_res($res)){ if (defined $hostId){ -&main::daemon_log("\n================================== 3.1", 1); $callobj = { method => 'getProductStates_hash', params => [ $hostId ], @@ -484,7 +482,6 @@ sub opsi_get_netboot_products { } } else { -&main::daemon_log("\n================================== 3.2", 1); foreach my $r (@{$res->result}) { $callobj = { method => 'getProduct_hash', @@ -508,7 +505,6 @@ sub opsi_get_netboot_products { } $xml_msg=~ s/<\/xxx>//; -&main::daemon_log("\n================================== 4", 1); # Return message return ( $xml_msg ); } -- 2.30.2