From 6b8be7fdb7aa333d3426c4e0c9690b917fdbf1da Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 26 Jan 2012 08:36:22 +0100 Subject: TCF Python: Fix FileSystemCommand._toSFError conversion bugs --- python/src/tcf/services/remote/FileSystemProxy.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/python/src/tcf/services/remote/FileSystemProxy.py b/python/src/tcf/services/remote/FileSystemProxy.py index 370625f69..203edd176 100644 --- a/python/src/tcf/services/remote/FileSystemProxy.py +++ b/python/src/tcf/services/remote/FileSystemProxy.py @@ -44,17 +44,20 @@ class FileSystemCommand(Command): super(FileSystemCommand, self).__init__(service.channel, service, command, args) def _toSFError(self, data): - if data is None: return None - error_code = map.get(errors.ERROR_CODE) + if data is None: + return None + error_code = data.get(errors.ERROR_CODE) cmd = self.getCommandString() - if len(cmd) > 72: cmd = cmd[0, 72] + "..." + if len(cmd) > 72: + cmd = cmd[0:72] + "..." s = Status(error_code, "TCF command exception:" + "\nCommand: " + cmd + - "\nException: " + self.toErrorString(data) + - "\nError code: " + error_code, map) - caused_by = map.get(errors.ERROR_CAUSED_BY) - if caused_by is not None: s.initCause(self.toError(caused_by, False)) + "\nException: " + errors.toErrorString(data) + + "\nError code: " + str(error_code), data) + caused_by = data.get(errors.ERROR_CAUSED_BY) + if caused_by is not None: + s.initCause(self.toError(caused_by, False)) return s class FileSystemProxy(filesystem.FileSystemService): @@ -396,7 +399,7 @@ class FileSystemProxy(filesystem.FileSystemService): assert handle.getService() is self done = self._makeCallback(done) id = handle.id - binary = bytearray(data[data_pos:data_pos+data_size]) + binary = bytearray(data[data_pos:data_pos + data_size]) service = self class WriteCommand(FileSystemCommand): def __init__(self): -- cgit v1.2.3