diff options
author | Gowtham Anandha Babu <gowtham.ab@samsung.com> | 2015-12-02 19:55:49 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-12-04 14:28:52 +0200 |
commit | fb5d75e1ab0e469e031ccaee1136b6e251594f45 (patch) | |
tree | ed6dac76c5044cbc0699cea0ae46fd41b6f4c0e4 | |
parent | 80cb86b2a5d8cb0cffa70591cbd0e576d20fbbf1 (diff) | |
download | bluez-fb5d75e1ab0e469e031ccaee1136b6e251594f45.tar.gz |
test: Fix ftp-client not printing progress
This patch fixes the keyError while printing transfer progress.
-rwxr-xr-x | test/ftp-client | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/ftp-client b/test/ftp-client index 78c32b3f7..4540602a0 100755 --- a/test/ftp-client +++ b/test/ftp-client @@ -77,16 +77,18 @@ class FtpClient: if path != self.transfer_path: return - if properties['Status'] == 'complete' or \ - properties['Status'] == 'error': + if "Status" in properties and \ + (properties['Status'] == 'complete' or \ + properties['Status'] == 'error'): if self.verbose: print("Transfer %s" % properties['Status']) mainloop.quit() return - if properties["Transferred"] == None: + if "Transferred" not in properties: return + value = properties["Transferred"] speed = (value - self.transferred) / 1000 print("Transfer progress %d/%d at %d kBps" % (value, self.transfer_size, |