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
9625d980
Commit
9625d980
authored
Jan 27, 2014
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Require extra-special force option (-F) to delete in-use dataset.
parent
50208b4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
utils/deletelease.in
utils/deletelease.in
+8
-4
No files found.
utils/deletelease.in
View file @
9625d980
#!/usr/bin/perl -w
#
# Copyright (c) 2013 University of Utah and the Flux Group.
# Copyright (c) 2013
-2014
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -31,15 +31,16 @@ use Date::Parse;
#
sub
usage
()
{
print
STDERR
"
Usage: deletelease [-fhd] lname
\n
";
print
STDERR
"
Usage: deletelease [-f
F
hd] lname
\n
";
print
STDERR
"
-h This message
\n
";
print
STDERR
"
-d Print additional debug info
\n
";
print
STDERR
"
-f Force destruction even if lease is not in the correct state
\n
";
print
STDERR
"
-F Force destruction even if lease is in use (admin only)
\n
";
print
STDERR
"
-w time Try for up to time seconds to lock lease (0 means forever)
\n
";
print
STDERR
"
lname Name of lease in <pid>/<id> form
\n
";
exit
(
-
1
);
}
my
$optlist
=
"
dhfw:
";
my
$optlist
=
"
dhf
F
w:
";
my
$debug
=
0
;
my
$force
=
0
;
my
$pid
;
...
...
@@ -92,6 +93,9 @@ if (defined($options{d})) {
if
(
defined
(
$options
{
f
}))
{
$force
=
1
;
}
if
(
defined
(
$options
{
F
}))
{
$force
=
2
;
}
if
(
defined
(
$options
{
w
}))
{
$waittime
=
$options
{
w
};
if
(
$waittime
!~
/^\d+$/
)
{
...
...
@@ -164,7 +168,7 @@ if (!defined($waittime)) {
# if the lease is in use, disallow unless forced
if
(
$lease
->
InUse
())
{
my
$expts
=
int
(
@
{
$lease
->
UsingResources
()});
if
(
!
$force
)
{
if
(
$force
<
2
)
{
fatal
("
$pid
/
$lname
is in use by
$expts
experiment(s) right now
");
}
print
STDERR
"
$pid
/
$lname
is in use by
$expts
experiment(s) right now,
"
.
...
...
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