Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
cd5edf1e
Commit
cd5edf1e
authored
Jan 22, 2014
by
Mike Hibler
Browse files
Allow destruction of a 'valid' lease that has not been used.
parent
a8e2d22a
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/deletelease.in
View file @
cd5edf1e
...
...
@@ -173,12 +173,20 @@ if ($lease->InUse()) {
# make sure we can destroy a lease from the current state.
if
(
!
$lease
->
ValidTransition
("
DEAD
"))
{
if
(
!
$force
)
{
fatal
("
$pid
/
$lname
: cannot destroy lease from state '
$ostate
'.
");
# XXX special case: if the lease is valid but has never been used, allow
if
(
$lease
->
state
()
eq
LEASE_STATE_VALID
()
&&
(
!
defined
(
$lease
->
last_used
())
||
$lease
->
last_used
()
==
0
||
$lease
->
last_used
()
==
$lease
->
inception
()))
{
print
STDERR
"
$pid
/
$lname
: lease is VALID but never used,
"
.
"
allowing destroy.
\n
";
}
else
{
if
(
!
$force
)
{
fatal
("
$pid
/
$lname
: cannot destroy lease from state '
$ostate
'.
");
}
print
STDERR
"
$pid
/
$lname
: should not destroy lease from state '
$ostate
',
"
.
"
continuing anyway.
\n
";
}
print
STDERR
"
$pid
/
$lname
: should not destroy lease from state '
$ostate
',
"
.
"
continuing anyway.
\n
";
}
# Dealloc will put the lease back into the unapproved state
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment