From daf8441268fa87efb39ea5f615ac2539ea064ebc Mon Sep 17 00:00:00 2001 From: rettenbe Date: Tue, 26 Aug 2008 08:50:38 +0000 Subject: [PATCH] bugfix: gosa-si can handle empty get_hardware opsi answers git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12271 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/opsi_com.pm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index 105c9b450..55d851a0b 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -767,21 +767,24 @@ sub opsi_get_client_hardware { my $res = $main::opsi_client->call($main::opsi_url, $callobj); if (not &check_opsi_res($res)){ my $result= $res->result; - foreach my $r (keys %{$result}){ - my $item= "\n".xml_quote($r).""; - my $value= $result->{$r}; - foreach my $sres (@{$value}){ - - foreach my $dres (keys %{$sres}){ - if (defined $sres->{$dres}){ - $item.= "<$dres>".xml_quote($sres->{$dres}).""; +print STDERR Dumper($result); + if (ref $result eq "HASH") { + foreach my $r (keys %{$result}){ + my $item= "\n".xml_quote($r).""; + my $value= $result->{$r}; + foreach my $sres (@{$value}){ + + foreach my $dres (keys %{$sres}){ + if (defined $sres->{$dres}){ + $item.= "<$dres>".xml_quote($sres->{$dres}).""; + } } + } + $item.= ""; + $xml_msg=~ s%%$item%; } - $item.= ""; - $xml_msg=~ s%%$item%; - } } -- 2.30.2