1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(logs): a job's rows carry the address it was asked from, and a cancel its own user

A job keeps the client address of its submission (Operation.client_ip,
migration operations.0003); the rows the worker writes for it, including the
migration's and the VM delete's own rows, carry it. A cancel is written under
the user who asked and from their address, also when an administrator
cancels another user's job; a running job's cancel gets a row when asked,
and its end a row when it stops. A resolution carries the administrator's
address.
This commit is contained in:
catborise 2026-11-07 14:25:18 +03:00
parent 528b4492f6
commit c5c6de6ba8
9 changed files with 85 additions and 14 deletions

View file

@ -214,6 +214,7 @@ def migrate_instance(
compress=False,
delete_source=False,
disk_pools=None,
ip=None,
on_moved=None,
):
"""Migrates instance to new_compute and logs the outcome (the mode
@ -226,7 +227,7 @@ def migrate_instance(
def log(action, error=None):
message = f"VM {instance.name}: {action}" + (f": {reason(error, user)}" if error is not None else "")
write(user.username, source.name, instance.name, message, error is None, uuid=instance.uuid)
write(user.username, source.name, instance.name, message, error is None, ip, instance.uuid)
conn_migrate = None
try: