From 2261a7f490c5c58952930420ddfd6a14f9557a23 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 19 Jan 2010 14:23:10 +0000 Subject: [PATCH] Updated getFullProductHostInformation to handle non objectID elements, too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15204 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/contrib/90_gosa.conf | 17 ++++++++++++----- gosa-si/server/events/opsi_com.pm | 4 ---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gosa-si/contrib/90_gosa.conf b/gosa-si/contrib/90_gosa.conf index 81eade305..72ae8b088 100644 --- a/gosa-si/contrib/90_gosa.conf +++ b/gosa-si/contrib/90_gosa.conf @@ -73,7 +73,8 @@ def getFullProductHostInformation_list(self, objectId=None, installationStatus=N productIds= self.getProductIds_list(type, None, installationStatus) # Load product states - productStates= self.getProductStates_hash(objectId) + if objectId != None: + productStates= self.getProductStates_hash(objectId) # Extend every entry by name and description for productId in productIds: @@ -85,10 +86,16 @@ def getFullProductHostInformation_list(self, objectId=None, installationStatus=N # Find product entry currentState= None - for state in productStates[objectId]: - if state['productId'] == productId: - currentState= state - break + if objectId != None: + for state in productStates[objectId]: + if state['productId'] == productId: + currentState= state + break + else: + state = {} + state['installationStatus'] = "not_installed" + state['actionRequest'] = "none" + currentState= state # Add missing information to the productInfo if currentState['installationStatus'] != "not_installed" or \ diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index 6b9f2b761..1c67f577e 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -2664,10 +2664,6 @@ sub _getProductStates_hash { sub _get_full_product_host_information { my %arg = ( 'hostId' => undef, @_ ); - if (not defined $arg{hostId}) { - return ("function requires hostId as parameter", 1); - } - my $res = &_callOpsi( method => 'getFullProductHostInformation_list', params => [$arg{hostId}]); my ($res_error, $res_error_str) = &check_opsi_res($res); if ($res_error){ return ((caller(0))[3]." : ".$res_error_str, 1); } -- 2.30.2