Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
5ea29f4b
Commit
5ea29f4b
authored
Aug 18, 2017
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix who sees the announcement after approving reservation.
parent
1dfe10c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
apt/manage_reservations.in
apt/manage_reservations.in
+12
-8
protogeni/lib/GeniCluster.pm.in
protogeni/lib/GeniCluster.pm.in
+17
-0
No files found.
apt/manage_reservations.in
View file @
5ea29f4b
...
...
@@ -97,7 +97,7 @@ sub DoApprove();
sub
DoSystemInfo
();
sub
DoPrediction
();
sub
readfile
($);
sub
AddAnnouncement
($$$$$$);
sub
AddAnnouncement
($$$$$$
$
);
sub
DeleteAnnouncement
($);
#
...
...
@@ -349,7 +349,7 @@ sub DoReserve()
#
# Schedule an announcement for the user.
#
AddAnnouncement
(
$portal
,
$brand
,
$uuid
,
$count
,
$type
,
$start
);
AddAnnouncement
(
$portal
,
$brand
,
$uuid
,
$this_user
,
$count
,
$type
,
$start
);
}
if
(
defined
(
$webtask
))
{
$webtask
->
approved
(
$approved
);
...
...
@@ -614,9 +614,13 @@ sub DoApprove()
# Schedule an announcement for the user.
#
my
$blob
=
$response
->
value
();
AddAnnouncement
(
$portal
,
$brand
,
$uuid
,
$blob
->
{'
nodes
'},
$blob
->
{'
type
'},
$blob
->
{'
start
'});
if
(
exists
(
$blob
->
{'
user
'}))
{
my
$geniuser
=
GeniUser
->
Lookup
(
$blob
->
{'
user
'},
1
);
if
(
defined
(
$geniuser
)
&&
$geniuser
->
IsLocal
())
{
AddAnnouncement
(
$portal
,
$brand
,
$uuid
,
$geniuser
->
emulab_user
(),
$blob
->
{'
nodes
'},
$blob
->
{'
type
'},
$blob
->
{'
start
'});
}
}
if
(
defined
(
$webtask
))
{
$webtask
->
Exited
(
0
);
}
...
...
@@ -953,10 +957,10 @@ sub readfile($) {
#
# Add or Edit a reservation announcement.
#
sub
AddAnnouncement
($$$$$$)
sub
AddAnnouncement
($$$$$$
$
)
{
my
(
$portal
,
$brand
,
$uuid
,
$nodes
,
$type
,
$start
)
=
@_
;
my
$this_uid
=
$
this_
user
->
uid
();
my
(
$portal
,
$brand
,
$uuid
,
$user
,
$nodes
,
$type
,
$start
)
=
@_
;
my
$this_uid
=
$user
->
uid
();
my
$nickname
=
$aggregate
->
nickname
();
my
$name
=
$aggregate
->
name
();
my
$url
=
$brand
->
wwwBase
()
.
...
...
protogeni/lib/GeniCluster.pm.in
View file @
5ea29f4b
...
...
@@ -1102,6 +1102,21 @@ sub ApproveReservation($)
print
STDERR
"$output
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_REFUSED
,
undef
,
$
output
);
}
my
$
pid
=
$
reservation
->
pid
();
my
$
project
=
Project
->
Lookup
($
pid
);
if
(
!defined($project)) {
print
STDERR
"ApproveReservation: No such project $pid
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not lookup project"
);
}
my
$
uid
=
$
reservation
->
uid
();
my
$
user
=
User
->
Lookup
($
uid
);
if
(
!defined($user)) {
print
STDERR
"ApproveReservation: No such user $uid
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not lookup project"
);
}
#
#
Return
current
details
of
the
reservation
.
#
...
...
@@ -1110,6 +1125,8 @@ sub ApproveReservation($)
$
blob
->{
"uuid"
}
=
$
reservation
->
uuid
();
$
blob
->{
"nodes"
}
=
$
reservation
->
nodes
();
$
blob
->{
"type"
}
=
$
reservation
->
type
();
$
blob
->{
"project"
}
=
$
project
->
nonlocalurn
();
$
blob
->{
"user"
}
=
$
user
->
nonlocalurn
();
$
blob
->{
"created"
}
=
TBDateStringGMT
($
reservation
->
created
());
$
blob
->{
"start"
}
=
TBDateStringGMT
($
reservation
->
start
());
$
blob
->{
"end"
}
=
TBDateStringGMT
($
reservation
->
end
());
...
...
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