Commit dec93290 authored by Leigh Stoller's avatar Leigh Stoller

Reset autoswap timeout to default at swapout time, for mere users.

parent 0693b078
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# Copyright (c) 2000-2018 University of Utah and the Flux Group. # Copyright (c) 2000-2019 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -1371,6 +1371,18 @@ elsif ($inout eq "modify") { ...@@ -1371,6 +1371,18 @@ elsif ($inout eq "modify") {
fatal("PostSwap failed!"); fatal("PostSwap failed!");
} }
#
# Reset autoswap to default. Might be inconvenient, but its interfering with
# reservations.
#
if ($inout eq "out" && !$isadmin && $pid eq TBOPSPID()) {
my $autoswapmode = TBGetSiteVar("general/autoswap_mode") ? 1 : 0;
my $autoswaptime = 60 * TBGetSiteVar("general/autoswap_threshold");
$experiment->SetAutoswap($autoswapmode);
$experiment->SetAutoswapTimeout($autoswaptime);
}
# Accounting info. For swapout, must be after its done with. # Accounting info. For swapout, must be after its done with.
$experiment->SetSwapInfo($this_user); $experiment->SetSwapInfo($this_user);
......
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