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
197f691c
Commit
197f691c
authored
Sep 29, 2010
by
Leigh B Stoller
Browse files
Lots of cleanup.
parent
30f7f8b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/scripts/resolve.in
View file @
197f691c
...
...
@@ -14,12 +14,10 @@ use Data::Dumper;
#
sub
usage
()
{
print
"
Usage: resolve <type>
[uuid | h
rn
]
\n
";
print
"
Usage: resolve <type>
<u
rn
>
\n
";
exit
(
1
);
}
my
$optlist
=
"";
my
$uuid
;
my
$hrn
;
#
# Configure variables
...
...
@@ -61,15 +59,8 @@ if (! getopts($optlist, \%options)) {
}
usage
()
if
(
@ARGV
!=
2
);
my
$type
=
$ARGV
[
0
];
my
$token
=
$ARGV
[
1
];
if
(
$type
=~
/^([\w]*)$/
)
{
$type
=
$
1
;
}
else
{
fatal
("
Illegal chars in type:
$type
");
}
my
$type
=
$ARGV
[
0
];
my
$urn
=
$ARGV
[
1
];
#
# Load the SA cert to act as caller context.
...
...
@@ -78,19 +69,17 @@ my $certificate = GeniCertificate->LoadFromFile($SACERT);
if
(
!
defined
(
$certificate
))
{
fatal
("
Could not load certificate from
$SACERT
\n
");
}
my
$context
=
Genixmlrpc
->
Context
(
$certificate
);
if
(
!
defined
(
$context
))
{
fatal
("
Could not create context to talk to clearinghouse
");
}
my
$clearinghouse
=
GeniRegistry::
ClearingHouse
->
Create
(
$context
);
Genixmlrpc
->
SetContext
(
Genixmlrpc
->
Context
(
$certificate
));
my
$clearinghouse
=
GeniRegistry::
ClearingHouse
->
Create
();
if
(
!
defined
(
$clearinghouse
))
{
fatal
("
Could not create a clearinghouse client
");
}
my
$value
;
if
(
$clearinghouse
->
Resolve
(
$
toke
n
,
uc
(
$type
),
\
$value
)
!=
0
)
{
fatal
("
Could not resolve
$
toke
n
at the clearinghouse
");
if
(
$clearinghouse
->
Resolve
(
$
ur
n
,
uc
(
$type
),
\
$value
)
!=
0
)
{
fatal
("
Could not resolve
$
ur
n
at the clearinghouse
");
}
print
Dumper
(
$value
);
exit
(
0
);
...
...
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