[pve-devel] [PATCH] move read_proc_mounts from NFSPlugin to Tools.

Wolfgang Link w.link at proxmox.com
Thu Sep 3 08:51:46 CEST 2015


this function will be uesd in more path of the code.
---
 PVE/Storage/NFSPlugin.pm | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm
index 68764b7..5ba6701 100644
--- a/PVE/Storage/NFSPlugin.pm
+++ b/PVE/Storage/NFSPlugin.pm
@@ -5,7 +5,7 @@ use warnings;
 use IO::File;
 use Net::IP;
 use File::Path;
-use PVE::Tools qw(run_command);
+use PVE::Tools qw(run_command read_proc_mounts);
 use PVE::Storage::Plugin;
 use PVE::JSONSchema qw(get_standard_option);
 
@@ -13,19 +13,6 @@ use base qw(PVE::Storage::Plugin);
 
 # NFS helper functions
 
-sub read_proc_mounts {
-    
-    local $/; # enable slurp mode
-    
-    my $data = "";
-    if (my $fd = IO::File->new("/proc/mounts", "r")) {
-	$data = <$fd>;
-	close ($fd);
-    }
-
-    return $data;
-}
-
 sub nfs_is_mounted {
     my ($server, $export, $mountpoint, $mountdata) = @_;
 
-- 
2.1.4




More information about the pve-devel mailing list