[lnst] Incorrect mode for file reading

Jiří Pírko jirka at fedoraproject.org
Mon Feb 4 15:44:24 UTC 2013


commit fc1bcfcfa7f012b8369d6b59438dc12ef2410fec
Author: Jan Tluka <jtluka at redhat.com>
Date:   Mon Feb 4 16:38:40 2013 +0100

    Incorrect mode for file reading
    
    Incorrect mode for file reading was specified for files to be copied to
    slaves. We need only 'read,binary' mode.
    
    Using current mode results in crash of the controller when run by
    ordinary non-root user because such user does not have modify access rights
    for the files in /usr/share.
    
    Signed-off-by: Jan Tluka <jtluka at redhat.com>

 lnst/Controller/NetTestController.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 042d197..df22a07 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -584,7 +584,7 @@ class NetTestController:
 
     def _copy_to_slave(self, local_path, machine_id, remote_path=None):
         remote_path = self._rpc_call(machine_id, "start_copy_to", remote_path)
-        f = open(local_path, "r+b")
+        f = open(local_path, "rb")
 
         while True:
             data = f.read(1024*1024) # 1MB buffer


More information about the LNST-developers mailing list