Code

Updated functions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Dec 2009 10:37:10 +0000 (10:37 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Dec 2009 10:37:10 +0000 (10:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14957 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/contrib/90_gosa.conf

index 1ae7362c77758afc2c2c04f8f6776aa3b52ec2bf..81eade305a8a7bab491194864d06a2e58fa72aa5 100644 (file)
@@ -63,73 +63,77 @@ def getProductInformation_list(self, installationStatus=None, type='localboot'):
     return result
 
 
-def getFullProductHostInformation_list(self, objectId=None, installationStatus=None, type='localboot'):
+def getFullProductHostInformation_list(self, objectId=None, installationStatus=None):
     result = []
 
-    # Load product ids
-    productIds= self.getProductIds_list(type, None, installationStatus)
-    
-    # Load product states
-    productStates= self.getProductStates_hash(objectId)
-
-    # Extend every entry by name and description
-    for productId in productIds:
-
-        # Add missing information to the productInfo
-        productInfo= self.getProduct_hash(productId)
-        productInfo['productId']= productId
-
-        # Find product entry
-        currentState= None
-        for state in productStates[objectId]:
-            if state['productId'] == productId:
-                currentState= state
-                break
-
-        # Add missing information to the productInfo
-        if currentState['installationStatus'] != "not_installed" or \
-            currentState['actionRequest'] == "setup":
-
-            # Add state for enabled products
-            productInfo['installationStatus']= currentState['installationStatus']
-            productInfo['actionRequest']= currentState['actionRequest']
-
-            # Add properties
-            productInfo['action']= self.getPossibleProductActions_list(productId)
-
-            # Load actual property values
-            propertyDefinitions= self.getProductPropertyDefinitions_listOfHashes(productId)
-            propertyValues= dict()
-            propertyDescriptions= dict()
-            propertyDefaults= dict()
-            
-            for property in propertyDefinitions:
-                if property.has_key('values'):
-                    propertyValues[property['name']]= property['values']
-                if property.has_key('description'):
-                    propertyDescriptions[property['name']]= property['description']
-                if property.has_key('default'):
-                    propertyDefaults[property['name']]= property['default']
-
-            # Load all properties and complete with values/descriptions
-            combinedProperties= dict()
-            productProperties= self.getProductProperties_hash(productId, objectId)
-            properties= productProperties.keys()
-            for property in properties:
-                combinedProperties[property]= dict()
-                if propertyDescriptions.has_key(property):
-                    combinedProperties[property]['description']= propertyDescriptions[property]
-                if propertyValues.has_key(property):
-                    combinedProperties[property]['values']= propertyValues[property]
-                if propertyDefaults.has_key(property):
-                    combinedProperties[property]['default']= propertyDefaults[property]
-                combinedProperties[property]['current']= productProperties[property]
-
-            # Add product properties to current product info
-            productInfo['properties']= combinedProperties
-
-        # Push information
-        result.append(productInfo)
+    types = ['localboot','netboot']
+    for type in types:
+
+        # Load product ids
+        productIds= self.getProductIds_list(type, None, installationStatus)
+        
+        # Load product states
+        productStates= self.getProductStates_hash(objectId)
+
+        # Extend every entry by name and description
+        for productId in productIds:
+
+            # Add missing information to the productInfo
+            productInfo= self.getProduct_hash(productId)
+            productInfo['productId']= productId
+            productInfo['type']= type;
+
+            # Find product entry
+            currentState= None
+            for state in productStates[objectId]:
+                if state['productId'] == productId:
+                    currentState= state
+                    break
+
+            # Add missing information to the productInfo
+            if currentState['installationStatus'] != "not_installed" or \
+                currentState['actionRequest'] == "setup":
+
+                # Add state for enabled products
+                productInfo['installationStatus']= currentState['installationStatus']
+                productInfo['actionRequest']= currentState['actionRequest']
+
+                # Add properties
+                productInfo['action']= self.getPossibleProductActions_list(productId)
+
+                # Load actual property values
+                propertyDefinitions= self.getProductPropertyDefinitions_listOfHashes(productId)
+                propertyValues= dict()
+                propertyDescriptions= dict()
+                propertyDefaults= dict()
+                
+                for property in propertyDefinitions:
+                    if property.has_key('values'):
+                        propertyValues[property['name']]= property['values']
+                    if property.has_key('description'):
+                        propertyDescriptions[property['name']]= property['description']
+                    if property.has_key('default'):
+                        propertyDefaults[property['name']]= property['default']
+
+                # Load all properties and complete with values/descriptions
+                combinedProperties= dict()
+                productProperties= self.getProductProperties_hash(productId, objectId)
+                properties= productProperties.keys()
+                for property in properties:
+                    combinedProperties[property]= dict()
+                    if propertyDescriptions.has_key(property):
+                        combinedProperties[property]['description']= propertyDescriptions[property]
+                    if propertyValues.has_key(property):
+                        combinedProperties[property]['values']= propertyValues[property]
+                    if propertyDefaults.has_key(property):
+                        combinedProperties[property]['default']= propertyDefaults[property]
+                    combinedProperties[property]['current']= productProperties[property]
+
+                # Add product properties to current product info
+                productInfo['properties']= combinedProperties
+
+            # Push information
+            result.append(productInfo)
 
     return result