Code

bugfix: opsi_del_product_from_client, correct and more detailed debug infos
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Aug 2008 14:25:15 +0000 (14:25 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Aug 2008 14:25:15 +0000 (14:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12168 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/server/events/opsi_com.pm
gosa-si/tests/client.php

index 329b192d966d6d92e26f3e10b58618dc500105aa..dcffe9f156a0a67e064b91714caf9fa0b489ce25 100644 (file)
@@ -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) );
   }
   
index c36cca351b24da98d29efb49678e3501c31a64fd..f5d8036a71b3803518fcb243861e14ba0921f69b 100755 (executable)
@@ -157,13 +157,13 @@ for($count = 1; $count <= $zahl; $count++)
     #$data = "<xml> <header>job_opsi_install_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e5</macaddress> </xml>";
 
     # Add Opsi client
-    $data = "<xml> <header>gosa_opsi_add_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <description>Test halt</description> </xml>";
+    #$data = "<xml> <header>gosa_opsi_add_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <description>Test halt</description> </xml>";
 
     # Add product to Opsi client
-    $data = "<xml> <header>gosa_opsi_add_product_to_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <productId>firefox</productId>  </xml>";
+    $data = "<xml> <header>gosa_opsi_add_product_to_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <productId>softprod</productId>  </xml>";
 
     # Delete product from Opsi client
-    #$data = "<xml> <header>gosa_opsi_del_product_from_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <productId>winxppro</productId>  </xml>";
+    $data = "<xml> <header>gosa_opsi_del_product_from_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-1.intranet.gonicus.de</hostId> <macaddress>00:11:25:4b:8c:e6</macaddress> <productId>softprod</productId>  </xml>";
 
     #########################
     # Mailqueue communication