''' Add a couple of additional functions to retrieve needed information with just one call. ''' def getClientsInformation_listOfHashes(self, serverId=None, depotIds=[], groupId=None, productId=None, installationStatus=None, actionRequest=None, productVersion=None, packageVersion=None): # Get backend instance and load client list bi= self.backends[self.clientManagingBackend]['instance'] clients= bi.getClients_listOfHashes(serverId, depotIds, groupId, productId, installationStatus, actionRequest, productVersion, packageVersion) # Get MAC and IP for every client for client in clients: client['macAddress']= bi.getMacAddress(client['hostId']) return clients def getProductHostInformation_list(self, objectId=None, installationStatus=None, type='localboot'): result = [] # Generate a dictionary for faster lookup of product IDs products= {} productIds= self.getProductIds_list(type, objectId, installationStatus) for productId in productIds: products[productId]= 1 # Load product states productStates= self.getProductStates_hash(objectId) # Extend every entry by name and description for product in productStates[objectId]: if not products.has_key(product['productId']): continue # Add missing information to the productInfo if product['installationStatus'] != "not_installed" or product['actionRequest'] == "setup": productInfo= self.getProduct_hash(product['productId']) productInfo['installationStatus']= product['installationStatus'] productInfo['actionRequest']= product['actionRequest'] productInfo['productId']= product['productId'] result.append(productInfo) return result def getProductInformation_list(self, installationStatus=None, type='localboot'): result = [] # Generate a dictionary for faster lookup of product IDs productIds= self.getProductIds_list(type, None, installationStatus) # 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 result.append(productInfo) return result