[pve-devel] r5019 - pve-storage/pve2

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Aug 16 14:09:01 CEST 2010


Author: dietmar
Date: 2010-08-16 12:09:01 +0000 (Mon, 16 Aug 2010)
New Revision: 5019

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/Storage.pm
Log:
* Storage.pm (file_read_firstline): import from PVE::Tools


Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2010-08-16 12:07:14 UTC (rev 5018)
+++ pve-storage/pve2/ChangeLog	2010-08-16 12:09:01 UTC (rev 5019)
@@ -1,7 +1,9 @@
 2010-08-16  Proxmox Support Team  <support at proxmox.com>
 
+	* Storage.pm (file_read_firstline): import from PVE::Tools
+
 	* Storage.pm: use new INotify class
-	
+
 	* Storage.pm (lock_config): renamed to lock_storage_config, use
 	lock_file from PVE::Utils
 

Modified: pve-storage/pve2/Storage.pm
===================================================================
--- pve-storage/pve2/Storage.pm	2010-08-16 12:07:14 UTC (rev 5018)
+++ pve-storage/pve2/Storage.pm	2010-08-16 12:09:01 UTC (rev 5019)
@@ -15,7 +15,7 @@
 use Getopt::Long qw(GetOptionsFromArray);
 use Socket;
 use Digest::SHA1;
-use PVE::Tools qw(run_command lock_file safe_print);
+use PVE::Tools qw(run_command lock_file safe_print file_read_firstline);
 use PVE::INotify qw(register_file read_file write_file);
 
 my $ISCSIADM = '/usr/bin/iscsiadm';
@@ -254,17 +254,6 @@
     } 
 }
 
-sub file_read_firstline {
-    my ($filename) = @_;
-
-    my $fh = IO::File->new ($filename, "r");
-    return undef if !$fh;
-    my $res = <$fh>;
-    chomp $res;
-    $fh->close;
-    return $res;
-}
-
 sub read_proc_mounts {
     
     local $/; # enable slurp mode




More information about the pve-devel mailing list