def list_storage_pools(apiclient, **kwargs): """List all storage pools matching criteria""" cmd = listStoragePools.listStoragePoolsCmd() [setattr(cmd, k, v) for k, v in kwargs.items()] if 'account' in kwargs.keys() and 'domainid' in kwargs.keys(): cmd.listall = True return (apiclient.listStoragePools(cmd))
def list_storage_pools(apiclient, **kwargs): """List all storage pools matching criteria""" cmd = listStoragePools.listStoragePoolsCmd() [setattr(cmd, k, v) for k, v in kwargs.items()] if "account" in kwargs.keys() and "domainid" in kwargs.keys(): cmd.listall = True return apiclient.listStoragePools(cmd)
def test_05_update_cmd(self): cmd = listStoragePools.listStoragePoolsCmd() storagePools = self.apiclient.listStoragePools(cmd) for pool in storagePools: if pool.type == 'NetworkFilesystem': cmd = updateStorageCapabilities.updateStorageCapabilitiesCmd() cmd.id = pool.id response = self.apiclient.updateStorageCapabilities(cmd) acceleration = getattr(response[0].storagecapabilities, "HARDWARE_ACCELERATION") self.assertNotEqual(acceleration, None, "Check Updated storage pool capabilities")
def find_storage_pool_type(apiclient, storagetype='NetworkFileSystem'): """ @name : find_storage_pool_type @Desc : Returns true if the given storage pool type exists @Input : type : type of the storage pool[NFS, RBD, etc.,] @Output : True : if the type of storage is found False : if the type of storage is not found FAILED In case the cmd failed """ cmd = listStoragePools.listStoragePoolsCmd() cmd_out = apiclient.listStoragePools(cmd) if validateList(cmd_out)[0] != PASS: return FAILED for storage_pool in cmd_out: if storage_pool.type.lower() == storagetype: return True return False
def list_storage_pools(apiclient, **kwargs): """List all storage pools matching criteria""" cmd = listStoragePools.listStoragePoolsCmd() [setattr(cmd, k, v) for k, v in kwargs.items()] return(apiclient.listStoragePools(cmd))
def list_storage_pools(apiclient, **kwargs): """List all storage pools matching criteria""" cmd = listStoragePools.listStoragePoolsCmd() [setattr(cmd, k, v) for k, v in kwargs.items()] return (apiclient.listStoragePools(cmd))