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
5043234d
Commit
5043234d
authored
Feb 27, 2017
by
Leigh B Stoller
Browse files
Add method to lookup an aggregate by shortname instead of URN.
parent
ef908699
Changes
1
Hide whitespace changes
Inline
Side-by-side
apt/APT_Aggregate.pm.in
View file @
5043234d
...
...
@@ -228,5 +228,28 @@ sub LookupForPortal($$)
return
@
result
;
}
#
#
Lookup
using
the
short
auth
name
(
emulab
.
net
).
#
sub
LookupByAuthName
($$)
{
my
($
class
,
$
authname
)
=
@
_
;
my
@
result
=
();
if
($
authname
!~ /^[-\w\.]+$/) {
return
undef
;
}
my
$
query_result
=
DBQueryWarn
(
"select urn from apt_aggregates "
.
"where urn like 'urn:publicid:IDN+${authname}+%'"
);
return
undef
if
(
!$query_result);
return
undef
if
(
!$query_result->numrows);
my
($
aggregate_urn
)
=
$
query_result
->
fetchrow_array
();
return
Lookup
($
class
,
$
aggregate_urn
);
}
#
_Always_
make
sure
that
this
1
is
at
the
end
of
the
file
...
1
;
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