From d5cd833811e088b04b456dcc42a5ade0abfc517b Mon Sep 17 00:00:00 2001 From: rettenbe Date: Wed, 6 Aug 2008 14:25:15 +0000 Subject: [PATCH] bugfix: opsi_del_product_from_client, correct and more detailed debug infos git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12168 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/opsi_com.pm | 17 +++++++++-------- gosa-si/tests/client.php | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index 329b192d9..dcffe9f15 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -128,7 +128,6 @@ sub opsi_del_product_from_client { method => 'getPossibleProductActions_list', params => [ $productId ], id => 1, }; - my $sres = $main::opsi_client->call($main::opsi_url, $callobj); my ($sres_err, $sres_err_string) = &check_opsi_res($sres); if ($sres_err){ @@ -143,8 +142,8 @@ sub opsi_del_product_from_client { } } if (!$uninst_possible){ - &main::daemon_log("$session_id ERROR: cannot uninstall product", 1); - &add_content2xml_hash($out_hash, "error", "product is not uninstallable"); + &main::daemon_log("$session_id ERROR: cannot uninstall product '$productId', product do not has the action 'uninstall'", 1); + &add_content2xml_hash($out_hash, "error", "cannot uninstall product '$productId', product do not has the action 'uninstall'"); return ( &create_xml_string($out_hash) ); } @@ -155,11 +154,13 @@ sub opsi_del_product_from_client { params => [ $productId, $hostId, "none" ], id => 1, }; - $sres = $main::opsi_client->call($main::opsi_url, $callobj); - my ($sres_err, $sres_err_string) = &check_opsi_res($sres); - if ($sres_err){ - &main::daemon_log("$session_id ERROR: cannot delete product: ".$sres_err_string, 1); - &add_content2xml_hash($out_hash, "error", $sres_err_string); +print STDERR Dumper($callobj); + + my $res = $main::opsi_client->call($main::opsi_url, $callobj); + my ($res_err, $res_err_string) = &check_opsi_res($res); + if ($res_err){ + &main::daemon_log("$session_id ERROR: cannot delete product: ".$res_err_string, 1); + &add_content2xml_hash($out_hash, "error", $res_err_string); return ( &create_xml_string($out_hash) ); } diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index c36cca351..f5d8036a7 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -157,13 +157,13 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
job_opsi_install_client
GOSA 00:01:6c:9d:b9:fa limux-cl-2.intranet.gonicus.de 00:11:25:4b:8c:e5
"; # Add Opsi client - $data = "
gosa_opsi_add_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 Test halt
"; + #$data = "
gosa_opsi_add_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 Test halt
"; # Add product to Opsi client - $data = "
gosa_opsi_add_product_to_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 firefox
"; + $data = "
gosa_opsi_add_product_to_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 softprod
"; # Delete product from Opsi client - #$data = "
gosa_opsi_del_product_from_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 winxppro
"; + $data = "
gosa_opsi_del_product_from_client
GOSA 00:01:6c:9d:b9:fa limux-cl-1.intranet.gonicus.de 00:11:25:4b:8c:e6 softprod
"; ######################### # Mailqueue communication -- 2.30.2