[pve-devel] r5459 - in pve-storage/pve2: . PVE PVE/API2

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jan 28 09:58:52 CET 2011


Author: dietmar
Date: 2011-01-28 09:58:52 +0100 (Fri, 28 Jan 2011)
New Revision: 5459

Modified:
   pve-storage/pve2/PVE/API2/Storage.pm
   pve-storage/pve2/PVE/Storage.pm
   pve-storage/pve2/pvesm
Log:
add simple helper to read storage config


Modified: pve-storage/pve2/PVE/API2/Storage.pm
===================================================================
--- pve-storage/pve2/PVE/API2/Storage.pm	2011-01-28 05:40:15 UTC (rev 5458)
+++ pve-storage/pve2/PVE/API2/Storage.pm	2011-01-28 08:58:52 UTC (rev 5459)
@@ -5,7 +5,7 @@
 
 use PVE::SafeSyslog;
 use PVE::JSONSchema qw(get_standard_option);
-use PVE::Cluster qw(cfs_read_file cfs_write_file);
+use PVE::Cluster;
 use PVE::Storage;
 use HTTP::Status qw(:constants);
 use Storable qw(dclone);
@@ -100,7 +100,7 @@
 
 	my $nodes = PVE::Cluster::get_nodelist();
 
-	my $cfg = cfs_read_file ("storage.cfg");
+	my $cfg = PVE::Storage::config();
 
 	my @sids =  PVE::Storage::storage_ids ($cfg);
 

Modified: pve-storage/pve2/PVE/Storage.pm
===================================================================
--- pve-storage/pve2/PVE/Storage.pm	2011-01-28 05:40:15 UTC (rev 5458)
+++ pve-storage/pve2/PVE/Storage.pm	2011-01-28 08:58:52 UTC (rev 5459)
@@ -32,6 +32,10 @@
 
 # generic utility function
 
+sub config {
+    return cfs_read_file("storage.cfg");
+}
+
 sub check_iscsi_support {
     my $noerr = shift;
 

Modified: pve-storage/pve2/pvesm
===================================================================
--- pve-storage/pve2/pvesm	2011-01-28 05:40:15 UTC (rev 5458)
+++ pve-storage/pve2/pvesm	2011-01-28 08:58:52 UTC (rev 5459)
@@ -54,7 +54,7 @@
     code => sub {
 	my ($param) = @_;
 
-	my $cfg = PVE::Cluster::cfs_read_file('storage.cfg');
+	my $cfg = PVE::Storage::config();
 
 	my $path = PVE::Storage::path ($cfg, $param->{volume});
 




More information about the pve-devel mailing list