Commit 0d661d9b authored by Mike Hibler's avatar Mike Hibler

When we move a lease to the locked state, make a note as to why.

The note is actually a lease attribute called 'why'.
parent 595a118c
......@@ -385,6 +385,9 @@ while (1) {
if (lockify($lease)) {
logit(" WARNING: $lease: could not lockdown, skipping");
} else {
# XXX make a note of why it is locked
$lease->SetAttribute("why", "lease_daemon_no_autodestroy");
......@@ -550,6 +553,8 @@ sub destroy($)
# If Dealloc fails, we put the lease in the locked state instead
if ($lease->DeallocResources()) {
# XXX make a note of why it is locked
$lease->SetAttribute("why", "lease_daemon_dealloc_failed");
notify("$lease: resource dealloc failed during destruction. Manual cleanup required.");
return 4;
......@@ -561,6 +566,8 @@ sub destroy($)
# If Delete fails, we are left in the unapproved state
if ($lease->Delete()) {
# XXX make a note of why it is here
$lease->SetAttribute("why", "lease_daemon_delete_failed");
notify("$lease: could not destroy lease, left in unapproved state. Manual cleanup required.");
return 5;
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