Skip to content
GitLab
Menu
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
14fba2b4
Commit
14fba2b4
authored
Aug 07, 2017
by
Leigh B Stoller
Browse files
Allow reservation lookup by uuid.
parent
3721db31
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Reservation.pm.in
View file @
14fba2b4
...
...
@@ -169,15 +169,24 @@ sub Lookup($$;$$$$)
return
undef
if
(
!$query_result || !$query_result->numrows);
}
else
{
#
Look
up
by
ID
.
my
$
idx
=
$
_
[
1
];
#
Look
up
by
ID
or
UUID
my
$
token
=
$
_
[
1
];
my
$
clause
;
if
($
token
=~
/^\
d
*$/)
{
$
clause
=
"idx='$token'"
;
}
elsif
(
ValidUUID
($
token
))
{
$
clause
=
"uuid='$token'"
;
}
else
{
return
undef
;
}
$
query_result
=
DBQueryWarn
(
"SELECT *, UNIX_TIMESTAMP(start) AS s, "
.
"UNIX_TIMESTAMP(end) AS e, "
.
"UNIX_TIMESTAMP(created) AS c, "
.
"UNIX_TIMESTAMP(approved) AS a "
.
"FROM future_reservations "
.
"WHERE
idx='$idx'
"
);
"WHERE
$clause
"
);
return
undef
if
(
!$query_result || !$query_result->numrows);
...
...
Write
Preview
Supports
Markdown
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