summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f47bd7)
raw | patch | inline | side by side (parent: 1f47bd7)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Aug 2008 08:41:03 +0000 (08:41 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Aug 2008 08:41:03 +0000 (08:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12179 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/opsi_com.pm | patch | blob | history | |
gosa-si/tests/client.php | patch | blob | history |
index 0e620426305f55f6174d05380df51e889b28858e..082bd9a63527b3a32f035f914141de134ccdd770 100644 (file)
if ($sres_err){
&main::daemon_log("$session_id ERROR: cannot create client: ".$sres_err_string, 1);
&add_content2xml_hash($out_hash, "error", $sres_err_string);
+ } else {
+ &main::daemon_log("$session_id INFO: add opsi client '$hostId' with mac '$mac'", 5);
}
}
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my ($productId, $hostId);
my $error = 0;
-
+print STDERR Dumper($msg_hash);
# 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) {
&add_content2xml_hash($out_hash, "error", "productId");
&main::daemon_log("$session_id ERROR: no productId specified or productId tag invalid: $msg", 1);
}
- if ((not exists $msg_hash->{'item'}) || (@{$msg_hash->{'item'}}[0] != 1)) {
+ if (not exists $msg_hash->{'item'}) {
$error++;
&add_content2xml_hash($out_hash, "item_error", "message needs one xml-tag 'item' and within the xml-tags 'name' and 'value'");
&add_content2xml_hash($out_hash, "error", "item");
&main::daemon_log("$session_id ERROR: message needs one xml-tag 'item' and within the xml-tags 'name' and 'value': $msg", 1);
} else {
- if ((not exists $msg_hash->{'item'}->{'name'}) || (@{$msg_hash->{'item'}->{'name'}}[0] != 1)) {
+ if ((not exists @{$msg_hash->{'item'}}[0]->{'name'}) || (@{@{$msg_hash->{'item'}}[0]->{'name'}} != 1 )) {
$error++;
&add_content2xml_hash($out_hash, "name_error", "message needs within the xml-tag 'item' one xml-tags 'name'");
&add_content2xml_hash($out_hash, "error", "name");
&main::daemon_log("$session_id ERROR: message needs within the xml-tag 'item' one xml-tags 'name': $msg", 1);
}
- if ((not exists $msg_hash->{'item'}->{'value'}) || (@{$msg_hash->{'item'}->{'value'}}[0] != 1)) {
+ if ((not exists @{$msg_hash->{'item'}}[0]->{'value'}) || (@{@{$msg_hash->{'item'}}[0]->{'value'}} != 1 )) {
$error++;
&add_content2xml_hash($out_hash, "value_error", "message needs within the xml-tag 'item' one xml-tags 'value'");
&add_content2xml_hash($out_hash, "error", "value");
my $res = $main::opsi_client->call($main::opsi_url, $callobj);
my ($res_err, $res_err_string) = &check_opsi_res($res);
-# TODO : This error message sounds strange
- if ($res_err){
- &man::daemon_log("$session_id ERROR: no communication failed while setting '".$item->{'name'}[0]."': ".$res_err_string, 1);
+# TODO : Diese Errormessage klingt komisch!
+ if (!$res_err){
+ &main::daemon_log("$session_id ERROR: no communication failed while setting '".$item->{'name'}[0]."'", 1);
&add_content2xml_hash($out_hash, "error", $res_err_string);
}
}
my $res = $main::opsi_client->call($main::opsi_url, $callobj);
if (not &check_opsi_res($res)){
foreach my $host (@{$res->result}){
+
+print STDERR Dumper($host);
my $item= "<item><name>".$host->{'hostId'}."</name>";
if (defined($host->{'description'})){
$item.= "<description>".xml_quote($host->{'description'})."</description>";
my $res = $main::opsi_client->call($main::opsi_url, $callobj);
if (not &check_opsi_res($res)){
my $result= $res->result;
-# TODO : fertig???
+# TODO : Ist das hier schon fertig???
}
$xml_msg=~ s/<xxx><\/xxx>//;
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $hostId;
my $error = 0;
- my $xml_msg;
# Build return message with twisted target and source
my $out_hash = &main::create_xml_hash("answer_$header", $main::server_address, $source);
index a228df5ff65d19921ce3feb672429de6e8f9774b..cf0843f486a320fcb70b70ef7d29607381a0171a 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
#$data = "<xml> <header>gosa_opsi_get_client_software</header> <source>GOSA</source> <target>GOSA</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId> </xml>";
# List Opsi clients
- #$data = "<xml> <header>gosa_opsi_list_clients</header> <source>GOSA</source> <target>GOSA</target> </xml>";
+ $data = "<xml> <header>gosa_opsi_list_clients</header> <source>GOSA</source> <target>GOSA</target> </xml>";
# Delete Opsi client
#$data = "<xml> <header>gosa_opsi_del_client</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <hostId>limux-cl-2.intranet.gonicus.de</hostId></xml>";