added docs and new patch

This commit is contained in:
ston1th 2021-04-18 12:39:35 +02:00
commit e8575df628
2 changed files with 183 additions and 6 deletions

View file

@ -1,29 +0,0 @@
--- PVE/Storage.pm.old 2020-11-02 19:09:57.318839122 +0100
+++ PVE/Storage.pm 2020-11-02 19:10:52.910426246 +0100
@@ -363,6 +363,15 @@
return $plugin->get_subdir($scfg, 'iso');
}
+sub get_snippet_dir {
+ my ($cfg, $storeid) = @_;
+
+ my $scfg = storage_config($cfg, $storeid);
+ my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+
+ return $plugin->get_subdir($scfg, 'snippets');
+}
+
sub get_vztmpl_dir {
my ($cfg, $storeid) = @_;
--- PVE/API2/Storage/Status.pm.old 2020-11-02 19:09:03.207241634 +0100
+++ PVE/API2/Storage/Status.pm 2020-11-02 19:09:26.631067308 +0100
@@ -424,6 +424,8 @@
raise_param_exc({ filename => "missing '.tar.gz' or '.tar.xz' extension" });
}
$path = PVE::Storage::get_vztmpl_dir($cfg, $param->{storage});
+ } elsif ($content eq 'snippets') {
+ $path = PVE::Storage::get_snippet_dir($cfg, $param->{storage});
} else {
raise_param_exc({ content => "upload content type '$content' not allowed" });
}