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
94132262
Commit
94132262
authored
Feb 08, 2012
by
Jonathon Duerig
Browse files
Don't have a <login> clause in manifest if user did not specify ssh-keys.
parent
62a267fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
db/Experiment.pm.in
View file @
94132262
...
...
@@ -4477,6 +4477,27 @@ sub BindNonLocalUser($$$$$$)
return 0;
}
sub HasNonLocalUsers($)
{
my ($self) = @_;
return 0
if (! ref($self));
my $exptidx = $self->idx();
my $query_result =
DBQueryWarn("select count(*) from nonlocal_user_accounts ".
"where exptidx='
$
exptidx
'");
return 0
if (!$query_result);
if ($query_result->numrows) {
my ($count) = $query_result->fetchrow_array();
return $count > 0;
} else {
return 0;
}
}
#
# Return physical interfaces for a link in an experiment.
#
...
...
protogeni/lib/GeniSliver.pm.in
View file @
94132262
...
...
@@ -780,19 +780,21 @@ sub AnnotateManifest($)
}
GeniXML::SetText("name", $host, $vhostname);
}
my $services = GeniXML::FindFirst("n:services", $rspec);
if (! defined($services)) {
$services = GeniXML::AddElement("services", $rspec);
}
my $login = GeniXML::FindFirst("n:login", $services);
if (! defined($login)) {
$login = GeniXML::AddElement("login", $services);
}
GeniXML::SetText("authentication", $login, "ssh-keys");
GeniXML::SetText("hostname", $login, $phostname);
GeniXML::SetText("port", $login, $sshdport);
GeniXML::SetText("username", $login, $user->uid());
if ($experiment->HasNonLocalUsers()) {
my $services = GeniXML::FindFirst("n:services", $rspec);
if (! defined($services)) {
$services = GeniXML::AddElement("services", $rspec);
}
my $login = GeniXML::FindFirst("n:login", $services);
if (! defined($login)) {
$login = GeniXML::AddElement("login", $services);
}
GeniXML::SetText("authentication", $login, "ssh-keys");
GeniXML::SetText("hostname", $login, $phostname);
GeniXML::SetText("port", $login, $sshdport);
GeniXML::SetText("username", $login, $user->uid());
}
if ($self->UpdateRspec($rspec)) {
print STDERR "Could not insert annotated manifest for node $self ".
...
...
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