[pve-devel] [PATCH manager] ceph api: added check for /etc/pve/ceph.conf to remaining/new endpoints

Tim Marx t.marx at proxmox.com
Tue Dec 11 11:08:56 CET 2018


Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
 PVE/API2/Ceph.pm     | 2 ++
 PVE/API2/Ceph/FS.pm  | 2 ++
 PVE/API2/Ceph/MDS.pm | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 76933dad..fc71205e 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -2013,6 +2013,8 @@ __PACKAGE__->register_method({
     },
     code => sub {
 	my ($param) = @_;
+	
+	PVE::CephTools::check_ceph_inited();
 
 	my $rpcenv = PVE::RPCEnvironment::get();
 	my $user = $rpcenv->get_user();
diff --git a/PVE/API2/Ceph/FS.pm b/PVE/API2/Ceph/FS.pm
index 084a3e28..d4becf1c 100644
--- a/PVE/API2/Ceph/FS.pm
+++ b/PVE/API2/Ceph/FS.pm
@@ -53,6 +53,8 @@ __PACKAGE__->register_method ({
     code => sub {
 	my ($param) = @_;
 
+	PVE::CephTools::check_ceph_inited();
+
 	my $rados = PVE::RADOS->new();
 
 	my $cephfs_list = $rados->mon_command({ prefix => "fs ls" });
diff --git a/PVE/API2/Ceph/MDS.pm b/PVE/API2/Ceph/MDS.pm
index 9a2791ae..dff28405 100644
--- a/PVE/API2/Ceph/MDS.pm
+++ b/PVE/API2/Ceph/MDS.pm
@@ -64,6 +64,8 @@ __PACKAGE__->register_method ({
     code => sub {
 	my ($param) = @_;
 
+	PVE::CephTools::check_ceph_inited();
+
 	my $res = [];
 
 	my $cfg = PVE::CephTools::parse_ceph_config();
-- 
2.11.0




More information about the pve-devel mailing list