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
d3674a3e
Commit
d3674a3e
authored
Dec 03, 2014
by
Leigh B Stoller
Browse files
Tweaks for Geni Portal keys.
parent
cd0d2c83
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/scripts/updategeniuser.in
View file @
d3674a3e
...
...
@@ -163,6 +163,8 @@ sub UpdateCredential()
#
sub
UpdateSSHKeys
()
{
my
$isportal
=
0
;
#
# Load the SA cert to act as caller context.
#
...
...
@@ -223,6 +225,7 @@ sub UpdateSSHKeys()
$url
=
"
https://ch.geni.net/MA
";
$method
=
"
lookup
";
@params
=
("
KEY
",
@params
);
$isportal
=
1
;
}
else
{
$url
=
$certificate
->
url
();
...
...
@@ -238,15 +241,29 @@ sub UpdateSSHKeys()
if
(
$response
->
code
()
!=
GENIRESPONSE_SUCCESS
)
{
fatal
("
Could not get keys:
"
.
$response
->
output
());
}
if
(
!
(
ref
(
$response
->
value
())
&&
exists
(
$response
->
value
()
->
{
$user_urn
})
&&
ref
(
$response
->
value
()
->
{
$user_urn
})))
{
fatal
("
Returned keys do not look right
");
if
(
!
ref
(
$response
->
value
()))
{
fatal
("
No key array returned in response
");
}
# Dig out the key list.
my
@keys
=
();
if
(
$isportal
)
{
foreach
my
$id
(
keys
(
%
{
$response
->
value
()
}))
{
my
$ref
=
$response
->
value
()
->
{
$id
};
push
(
@keys
,
$ref
);
}
}
else
{
if
(
!
exists
(
$response
->
value
()
->
{
$user_urn
})
&&
ref
(
$response
->
value
()
->
{
$user_urn
}))
{
print
STDERR
Dumper
(
$response
);
fatal
("
Returned keys do not look right
");
}
@keys
=
@
{
$response
->
value
()
->
{
$user_urn
}
};
}
my
@keys
=
@
{
$response
->
value
()
->
{
$user_urn
}
};
if
(
!
@keys
)
{
fatal
("
No keys returned for user!
");
}
}
my
$filename
=
TBMakeTempFile
("
geniuserkey
");
#
...
...
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