[PATCH] Incorrect mode for file reading

Jan Tluka jtluka at redhat.com
Mon Feb 4 15:38:40 UTC 2013


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
-- 
1.7.7.6



More information about the LNST-developers mailing list