mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
only send 1 email for rtp expiration notices
This commit is contained in:
parent
a20fd1d873
commit
d0995365dd
1 changed files with 3 additions and 3 deletions
|
@ -80,10 +80,10 @@ def process_expiring_vms_task():
|
||||||
db = connect_db()
|
db = connect_db()
|
||||||
starrs = connect_starrs()
|
starrs = connect_starrs()
|
||||||
pools = get_pools(proxmox, db)
|
pools = get_pools(proxmox, db)
|
||||||
|
expired_vms = []
|
||||||
for pool in pools:
|
for pool in pools:
|
||||||
user = User(pool)
|
user = User(pool)
|
||||||
expiring_vms = []
|
expiring_vms = []
|
||||||
expired_vms = []
|
|
||||||
vms = user.vms
|
vms = user.vms
|
||||||
for vm in vms:
|
for vm in vms:
|
||||||
vm = VM(vm['vmid'])
|
vm = VM(vm['vmid'])
|
||||||
|
@ -103,8 +103,8 @@ def process_expiring_vms_task():
|
||||||
delete_vm_task(vm.id)
|
delete_vm_task(vm.id)
|
||||||
if expiring_vms:
|
if expiring_vms:
|
||||||
send_vm_expire_email(pool, expiring_vms)
|
send_vm_expire_email(pool, expiring_vms)
|
||||||
if expired_vms:
|
if expired_vms:
|
||||||
send_rtp_vm_delete_email(expired_vms)
|
send_rtp_vm_delete_email(expired_vms)
|
||||||
|
|
||||||
|
|
||||||
def generate_pool_cache_task():
|
def generate_pool_cache_task():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue