Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
112
Issues
112
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
5780e2ea
Commit
5780e2ea
authored
Jan 23, 2009
by
Leigh Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Given a slice, see if we have a ticket issued for it in the DB.
parent
cba00b15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
protogeni/lib/GeniTicket.pm.in
protogeni/lib/GeniTicket.pm.in
+26
-1
No files found.
protogeni/lib/GeniTicket.pm.in
View file @
5780e2ea
...
...
@@ -94,6 +94,31 @@ sub Lookup($$)
return
$
ticket
;
}
#
#
Lookup
a
ticket
for
a
slice
.
This
assumes
only
a
single
slice
ticket
.
#
sub
LookupForSlice
($$)
{
my
($
class
,
$
slice
)
=
@
_
;
return
undef
if
(
! ref($slice));
my
$
slice_uuid
=
$
slice
->
uuid
();
my
$
query_result
=
DBQueryWarn
(
"select idx from geni_tickets "
.
"where slice_uuid='$slice_uuid'"
);
return
undef
if
(
!$query_result || !$query_result->numrows);
if
($
query_result
->
numrows
!= 1) {
print
STDERR
"Too many tickets stored for $slice
\n
"
;
return
undef
;
}
my
($
idx
)
=
$
query_result
->
fetchrow_array
();
return
GeniTicket
->
Lookup
($
idx
);
}
#
#
Create
an
unsigned
ticket
object
,
to
be
populated
and
signed
and
returned
.
#
...
...
@@ -120,7 +145,7 @@ sub Create($$$$)
#
For
now
,
all
tickets
expire
very
quickly
...
#
$
self
->{
'redeem_before'
}
=
POSIX
::
strftime
(
"20%y-%m-%dT%H:%M:%S"
,
localtime
(
time
()
+
(
2
*
60
)));
POSIX
::
strftime
(
"20%y-%m-%dT%H:%M:%S"
,
localtime
(
time
()
+
(
5
*
60
)));
#
#
Locally
generated
tickets
need
a
local
DB
index
,
which
can
be
the
...
...
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