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
b11e7973
Commit
b11e7973
authored
Jun 05, 2017
by
Leigh B Stoller
Browse files
Fix for issue
#299
... waiting for Rob to test before closing.
parent
b7d65aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
apt/manage_instance.in
View file @
b11e7973
...
...
@@ -144,7 +144,7 @@ sub StartMonitor();
sub
StartMonitorInternal
(
;
$@
);
sub
DoImageTrackerStuff
($$$$$$$);
sub
DenyExtensionInternal
($);
sub
ExtendInternal
($$$$);
sub
ExtendInternal
($$$$
$
);
#
# Parse command arguments. Once we return from getopts, all that should be
...
...
@@ -1543,7 +1543,7 @@ sub DoExtend()
my
$seconds
=
$granted
*
3600
;
$seconds
*=
24
if
(
!
$inhours
);
if
(
$errcode
=
ExtendInternal
(
$slice
,
$seconds
,
0
,
\
$errmsg
))
{
if
(
$errcode
=
ExtendInternal
(
$slice
,
$seconds
,
0
,
0
,
\
$errmsg
))
{
goto
bad
;
}
}
...
...
@@ -1660,9 +1660,9 @@ sub DoExtend()
}
exit
(
$errcode
);
}
sub
ExtendInternal
($$$$)
sub
ExtendInternal
($$$$
$
)
{
my
(
$slice
,
$seconds
,
$force
,
$perrmsg
)
=
@_
;
my
(
$slice
,
$seconds
,
$force
,
$nolockdown
,
$perrmsg
)
=
@_
;
my
$lockdown
=
0
;
my
$errcode
=
-
1
;
my
$errmsg
;
...
...
@@ -1671,7 +1671,7 @@ sub ExtendInternal($$$$)
my
$oldexpires
=
$slice
->
expires
();
# Lockdown on admin extensions longer then XX days.
if
(
defined
(
$this_user
)
&&
$this_user
->
IsAdmin
()
&&
if
(
defined
(
$this_user
)
&&
$this_user
->
IsAdmin
()
&&
!
$nolockdown
&&
(
$seconds
/
(
24
*
60
*
60
))
>
10
)
{
$lockdown
=
1
}
...
...
@@ -3823,9 +3823,16 @@ sub DoSchedTerminate()
# a legal thing to do (although our CM actually permits this).
#
if
(
$expires_time
<
time
()
+
(
$days
*
3600
*
24
))
{
my
$seconds
=
(
time
()
+
(
$days
*
3600
*
24
))
-
$expires_time
;
my
$seconds
;
if
(
$errcode
=
ExtendInternal
(
$slice
,
$seconds
,
1
,
\
$errmsg
))
{
if
(
$slice
->
IsExpired
())
{
# ExtendInternal handles expired slices differently.
$seconds
=
(
$days
*
3600
*
24
);
}
else
{
$seconds
=
(
time
()
+
(
$days
*
3600
*
24
))
-
$expires_time
;
}
if
(
$errcode
=
ExtendInternal
(
$slice
,
$seconds
,
1
,
1
,
\
$errmsg
))
{
goto
bad
;
}
}
...
...
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