summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42e0704)
raw | patch | inline | side by side (parent: 42e0704)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Oct 2008 10:29:08 +0000 (10:29 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Oct 2008 10:29:08 +0000 (10:29 +0000) |
* add function opsi_client2string to GosaSupportDaemon.pm
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12778 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12778 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history | |
gosa-si/server/events/opsi_com.pm | patch | blob | history |
index 65bea486ad1499fab5cd1e2d101c9875cfef8028..2e971370ac48c8dd948eed0153cc36d5e41e5565 100644 (file)
"read_configfile",
"check_opsi_res",
"calc_timestamp",
+ "opsi_callobj2string",
);
@EXPORT = @functions;
use strict;
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;
index 80a5899470df314c82e2a93b52277dda7ffd8ce1..e1fd6486f0315fb9956888dc1b72cb53163e5e42 100644 (file)
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) {
&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 = {
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 ],
}
} else {
-&main::daemon_log("\n================================== 3.2", 1);
foreach my $r (@{$res->result}) {
$callobj = {
method => 'getProduct_hash',
}
$xml_msg=~ s/<xxx><\/xxx>//;
-&main::daemon_log("\n================================== 4", 1);
# Return message
return ( $xml_msg );
}