From: rettenbe Date: Mon, 27 Oct 2008 10:29:08 +0000 (+0000) Subject: * delete debug lines for opsi_get_netboot_product problem X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b48f2070408b3b9898dd3bd53921c831b245222;p=gosa.git * 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 --- 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 ); }