mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 08:20:04 +00:00
cloud-init: sshkeys are now files on the CLI
This requires a pve-common patch since we need to not only load the file but also url-encode it. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9ed7a77c6e
commit
3351aacc70
@ -10,6 +10,7 @@ use Fcntl ':flock';
|
||||
use File::Path;
|
||||
use IO::Socket::UNIX;
|
||||
use IO::Select;
|
||||
use URI::Escape;
|
||||
|
||||
use PVE::Tools qw(extract_param);
|
||||
use PVE::Cluster;
|
||||
@ -663,6 +664,20 @@ my $print_agent_result = sub {
|
||||
print to_json($result, { pretty => 1, canonical => 1});
|
||||
};
|
||||
|
||||
sub param_mapping {
|
||||
my ($name) = @_;
|
||||
|
||||
my $ssh_key_map = ['sshkeys', sub {
|
||||
return URI::Escape::uri_escape(PVE::Tools::file_get_contents($_[0]));
|
||||
}];
|
||||
my $mapping = {
|
||||
'update_vm' => [$ssh_key_map],
|
||||
'create_vm' => [$ssh_key_map],
|
||||
};
|
||||
|
||||
return $mapping->{$name};
|
||||
}
|
||||
|
||||
our $cmddef = {
|
||||
list => [ "PVE::API2::Qemu", 'vmlist', [],
|
||||
{ node => $nodename }, sub {
|
||||
|
Loading…
Reference in New Issue
Block a user