[sysadmin-bin] Revert "Fix ftpadmin chocking on files without a newline at the end"



commit 175e09a45e234272de1d8a6d42c513f01b68b588
Author: Andrea Veri <averi redhat com>
Date:   Tue Apr 9 00:08:30 2019 +0200

    Revert "Fix ftpadmin chocking on files without a newline at the end"
    
    This reverts commit 1fe43bd14ec12a702e80be311f7e755219374281.
    
    The read() method reads file char-by-char which definitely is a no-go
    for files that are big enough to hang the ftpadmin process when reading
    the NEWS or ChangeLog files from glusterfs.

 ftpadmin | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/ftpadmin b/ftpadmin
index 8d11184..ec81c75 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -513,7 +513,7 @@ class TarInfo(BasicInfo):
                 size_files += info.size
 
                 if info.name in files:
-                    self.file[os.path.basename(info.name)] = t.extractfile(info).read()
+                    self.file[os.path.basename(info.name)] = t.extractfile(info).readlines()
 
                 if file_count == 1:
                     if '/' in info.name.lstrip('/'):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]