Commit ca9e1f82 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor changes to update_users in PerformOperationalAction().

parent 7a7f36fb
...@@ -1194,20 +1194,21 @@ sub PerformOperationalAction ...@@ -1194,20 +1194,21 @@ sub PerformOperationalAction
return GeniResponse->MalformedArgsResponse("No keys provided!"); return GeniResponse->MalformedArgsResponse("No keys provided!");
} }
my $users = $options->{'geni_users'}; my $users = $options->{'geni_users'};
if (! (ref($users) && ref($users) eq "ARRAY")) {
return GeniResponse->MalformedArgsResponse("Malformed keys!");
}
my $sliver_keys = []; my $sliver_keys = [];
if (defined($users) && @$users) { foreach my $user (@$users) {
foreach my $user (@$users) { my $user_urn = $user->{'urn'};
my $user_urn = $user->{'urn'}; my @user_keys = ();
my @user_keys = ();
foreach my $key (@{ $user->{'keys'} }) {
foreach my $key (@{ $user->{keys} }) { # The CMV2 does not like newlines at the end of the keys.
# The CMV2 does not like newlines at the end of the keys. chomp($key);
chomp($key); push(@user_keys, {'type' => 'ssh', 'key' => $key});
push(@user_keys, {'type' => 'ssh', 'key' => $key});
}
push(@{$sliver_keys}, {'urn' => $user_urn,
'keys' => \@user_keys});
} }
push(@{$sliver_keys}, {'urn' => $user_urn,
'keys' => \@user_keys});
} }
$args->{'slice_urn'} = $slice->urn(); $args->{'slice_urn'} = $slice->urn();
$args->{'keys'} = $sliver_keys; $args->{'keys'} = $sliver_keys;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment