mirror of
				https://github.com/ComputerScienceHouse/proxstar.git
				synced 2025-03-09 15:40:09 +00:00 
			
		
		
		
	only retrieve ignored_pools once, add paramter for get_pools in tasks
This commit is contained in:
		
							parent
							
								
									e96c8cf4cf
								
							
						
					
					
						commit
						85a5e74a6b
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -274,10 +274,10 @@ def mount_vm_iso(proxmox, vmid, iso):
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
def get_pools(proxmox, db):
 | 
			
		||||
    ignored_pools = get_ignored_pools(db)
 | 
			
		||||
    pools = []
 | 
			
		||||
    for pool in proxmox.pools.get():
 | 
			
		||||
        poolid = pool['poolid']
 | 
			
		||||
        ignored_pools = get_ignored_pools(db)
 | 
			
		||||
        if poolid not in ignored_pools and is_user(poolid):
 | 
			
		||||
            pools.append(poolid)
 | 
			
		||||
    pools = sorted(pools)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,7 +76,7 @@ def process_expiring_vms_task():
 | 
			
		|||
        proxmox = connect_proxmox()
 | 
			
		||||
        db = connect_db()
 | 
			
		||||
        starrs = connect_starrs()
 | 
			
		||||
        pools = get_pools(proxmox)
 | 
			
		||||
        pools = get_pools(proxmox, db)
 | 
			
		||||
        for pool in pools:
 | 
			
		||||
            expiring_vms = []
 | 
			
		||||
            vms = get_vms_for_user(proxmox, db, pool)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue