Code

Bugfix, get_hosts_with_modules. Correct localhost answer. Andi
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Oct 2008 09:29:16 +0000 (09:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Oct 2008 09:29:16 +0000 (09:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12650 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index aca15bd76380b7af957048418614f118982523fc..a538f366c0d51f8e698c664701001e54a1673352 100644 (file)
@@ -1203,7 +1203,10 @@ sub get_hosts_with_module {
         my ($local_ip, $local_port) = split(/:/, $target);
         my $network_interface= &get_interface_for_ip($local_ip);
         my $local_mac = &get_mac_for_interface($network_interface);
-        &add_content2xml_hash($out_hash, "answer0", $local_mac);
+        $out_msg =~ s/<\/xml>/<result>host0<\/result> <\/xml>/;
+        my $host_infos = "<ip>$local_ip</ip>";
+        $host_infos .= " <mac>$local_mac</mac>"; 
+        $out_msg =~  s/<\/xml>/\n<answer0> $host_infos <\/answer0> \n <\/xml>/;
     }
 
     
index fd1d52dbbcfbf21c19e2938e433e6cfe74aff3b0..437700e2001c92db0f43fd5c09d1e41f0ed51e7e 100755 (executable)
@@ -9,7 +9,7 @@ $zahl= 1;
 for($count = 1; $count <= $zahl; $count++)
 {
 
-  $sock = new Socket_Client("127.0.0.1","20082",TRUE,5);
+  $sock = new Socket_Client("127.0.0.1","20081",TRUE,5);
   $sock->setEncryptionKey("secret-gosa-password");
   #$sock = new Socket_Client("10.89.1.30","20081",TRUE,5);
   #$sock->setEncryptionKey("secret-gosa-password");
@@ -214,6 +214,9 @@ for($count = 1; $count <= $zahl; $count++)
     # SYSLOG reload
     #$data = "<xml> <header>gosa_trigger_reload_syslog_config</header> <source>GOSA</source> <target>GOSA</target> <macaddress>00:01:6c:9d:b9:fa</macaddress> </xml>"; 
 
+
+       $data ="<xml><header>gosa_get_hosts_with_module</header><source>GOSA</source><target>10.3.67.137:20081</target><module_name>opsi_com</module_name></xml>";
+
     $sock->write($data);
     $answer = "nothing";
     $answer = $sock->read();