Commit ed82b05c authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fix to very first expiration warning to prevent immediate warning.

Change the From: header to "Geni Operations".
parent 4cf74248
...@@ -358,7 +358,7 @@ sub WarnSlices() ...@@ -358,7 +358,7 @@ sub WarnSlices()
# If this was created in the last hour, skip the actual # If this was created in the last hour, skip the actual
# email. Wait until the second warning. # email. Wait until the second warning.
# #
if ($stamp - $created < $minwarn) { if (time() - $created < $minwarn) {
print STDERR "Skipping email for just created sliver $aggregate\n"; print STDERR "Skipping email for just created sliver $aggregate\n";
$expires{$idx} = $stamp; $expires{$idx} = $stamp;
$slice->UnLock(); $slice->UnLock();
...@@ -398,7 +398,7 @@ sub WarnSlices() ...@@ -398,7 +398,7 @@ sub WarnSlices()
"is going to expire in approximately $diff $unit.\n\n". "is going to expire in approximately $diff $unit.\n\n".
"Please renew it". "Please renew it".
" or let it expire if you are not using it anymore.\n", " or let it expire if you are not using it anymore.\n",
undef); "Geni Operations <$TBOPS>");
} }
$slice->UnLock(); $slice->UnLock();
skip: skip:
...@@ -1198,7 +1198,7 @@ sub CheckIdle() ...@@ -1198,7 +1198,7 @@ sub CheckIdle()
"and is using $nodes physical nodes.\n\n". "and is using $nodes physical nodes.\n\n".
"$stats\n". "$stats\n".
"You will not be allowed to renew this sliver!\n", "You will not be allowed to renew this sliver!\n",
$TBAUTOMAIL, "CC: $TBAUTOMAIL"); "Geni Operations <$TBOPS>", "CC: $TBAUTOMAIL");
$slice->SetRenewLimit(0); $slice->SetRenewLimit(0);
} }
...@@ -1230,7 +1230,7 @@ sub CheckIdle() ...@@ -1230,7 +1230,7 @@ sub CheckIdle()
"You will not be allowed to renew this sliver ") : "You will not be allowed to renew this sliver ") :
"This sliver might be terminated ") . "This sliver might be terminated ") .
"if it stays idle.\n", "if it stays idle.\n",
$TBAUTOMAIL, "CC: $TBAUTOMAIL"); "Geni Operations <$TBOPS>", "CC: $TBAUTOMAIL");
emdb::DBQueryWarn("update experiments set ". emdb::DBQueryWarn("update experiments set ".
" swap_requests=swap_requests+1, ". " swap_requests=swap_requests+1, ".
......
...@@ -299,7 +299,7 @@ sub WarnSlices() ...@@ -299,7 +299,7 @@ sub WarnSlices()
"Slice $urn\n". "Slice $urn\n".
"is going to expire in approximately $diff $unit.\n". "is going to expire in approximately $diff $unit.\n".
"Please renew it or let it expire if you not using it.\n", "Please renew it or let it expire if you not using it.\n",
undef); "Geni Operations <$TBOPS>");
} }
$warned{$idx} = time(); $warned{$idx} = time();
$expires{$idx} = $stamp; $expires{$idx} = $stamp;
...@@ -380,7 +380,7 @@ sub ExpireSlices() ...@@ -380,7 +380,7 @@ sub ExpireSlices()
SENDMAIL($emailaddr, "Slice $urn has expired", SENDMAIL($emailaddr, "Slice $urn has expired",
"Slice $urn\n". "Slice $urn\n".
"has been expired. Sorry :-(\n", "has been expired. Sorry :-(\n",
undef); "Geni Operations <$TBOPS>");
} }
delete($warned{"$idx"}); delete($warned{"$idx"});
delete($expires{"$idx"}); delete($expires{"$idx"});
......
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