Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
cd5edf1e
Commit
cd5edf1e
authored
Jan 22, 2014
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow destruction of a 'valid' lease that has not been used.
parent
a8e2d22a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
utils/deletelease.in
utils/deletelease.in
+13
-5
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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