Commit babc7544 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

cyclades: Log project reassign actions

parent a79f0a58
...@@ -236,6 +236,8 @@ def delete_floating_ip(floating_ip): ...@@ -236,6 +236,8 @@ def delete_floating_ip(floating_ip):
def reassign_floating_ip(floating_ip, project): def reassign_floating_ip(floating_ip, project):
action_fields = {"to_project": project, action_fields = {"to_project": project,
"from_project": floating_ip.project} "from_project": floating_ip.project}
log.info("Reassigning floating IP %s from project %s to %s",
floating_ip, floating_ip.project, project)
floating_ip.project = project floating_ip.project = project
floating_ip.save() floating_ip.save()
quotas.issue_and_accept_commission(floating_ip, action="REASSIGN", quotas.issue_and_accept_commission(floating_ip, action="REASSIGN",
......
...@@ -179,6 +179,8 @@ def delete(network): ...@@ -179,6 +179,8 @@ def delete(network):
@network_command("REASSIGN") @network_command("REASSIGN")
def reassign(network, project): def reassign(network, project):
action_fields = {"to_project": project, "from_project": network.project} action_fields = {"to_project": project, "from_project": network.project}
log.info("Reassigning network %s from project %s to %s",
network, network.project, project)
network.project = project network.project = project
network.save() network.save()
quotas.issue_and_accept_commission(network, action="REASSIGN", quotas.issue_and_accept_commission(network, action="REASSIGN",
......
...@@ -336,6 +336,8 @@ def _resize(vm, flavor): ...@@ -336,6 +336,8 @@ def _resize(vm, flavor):
@transaction.commit_on_success @transaction.commit_on_success
def reassign(vm, project): def reassign(vm, project):
action_fields = {"to_project": project, "from_project": vm.project} action_fields = {"to_project": project, "from_project": vm.project}
log.info("Reassigning VM %s from project %s to %s",
vm, vm.project, project)
vm.project = project vm.project = project
vm.save() vm.save()
quotas.issue_and_accept_commission(vm, action="REASSIGN", quotas.issue_and_accept_commission(vm, action="REASSIGN",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment