Commit 9391d2df authored by Leigh B Stoller's avatar Leigh B Stoller

Use APT/Cloud (brand) specific email from the APT instance library, for

expire warning email.
parent f129a645
...@@ -233,6 +233,8 @@ sub WarnSlices() ...@@ -233,6 +233,8 @@ sub WarnSlices()
# Slice is gone, lets not worry. # Slice is gone, lets not worry.
next; next;
} }
my $slice_uuid = $slice->uuid();
if ($slice->Lock() != 0) { if ($slice->Lock() != 0) {
print STDERR "Could not lock slice $slice.\n"; print STDERR "Could not lock slice $slice.\n";
goto skip; goto skip;
...@@ -295,11 +297,19 @@ sub WarnSlices() ...@@ -295,11 +297,19 @@ sub WarnSlices()
else { else {
print STDERR print STDERR
"Sending mail to $geniuser about expiring slice $idx,$hrn\n"; "Sending mail to $geniuser about expiring slice $idx,$hrn\n";
SENDMAIL($emailaddr, "Slice $urn expiring",
# Do not expose slices to APT/Cloud users.
my $instance = APT_Instance->LookupBySlice($slice_uuid);
if (defined($instance)) {
$instance->WarnExpiring("$diff $unit");
}
else {
SENDMAIL($emailaddr, "Slice $urn expiring",
"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",
"Geni Operations <$TBOPS>"); "Geni Operations <$TBOPS>");
}
} }
$warned{$idx} = time(); $warned{$idx} = time();
$expires{$idx} = $stamp; $expires{$idx} = $stamp;
......
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