Merge lp:~pawciobiel/testdrive/1187173-rsync-connection-timeout into lp:testdrive

Proposed by pawciobiel
Status: Merged
Merged at revision: 449
Proposed branch: lp:~pawciobiel/testdrive/1187173-rsync-connection-timeout
Merge into: lp:testdrive
Diff against target: 39 lines (+10/-1)
2 files modified
bin/testdrive-gtk (+9/-0)
testdrive/testdrive.py (+1/-1)
To merge this branch: bzr merge lp:~pawciobiel/testdrive/1187173-rsync-connection-timeout
Reviewer Review Type Date Requested Status
Andres Rodriguez Approve
Review via email: mp+234515@code.launchpad.net

Description of the change

Hi,
I added a quick fix for lp:1187173

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/testdrive-gtk'
2--- bin/testdrive-gtk 2013-11-17 08:19:27 +0000
3+++ bin/testdrive-gtk 2014-09-12 17:17:43 +0000
4@@ -860,6 +860,7 @@
5
6 def run(self):
7 cmd = self.command.split()
8+ logging.debug("executing command `%s`", ' '.join(cmd))
9 self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines = True)
10 percent = re.compile(r'(\d+)%')
11 self.status_label.show()
12@@ -887,6 +888,14 @@
13 prev = match.group(1)
14 text = _(" Downloading %s (%s%%)") % (os.path.basename(self.url).partition("_")[2], prev)
15 self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text)
16+ if self.p and self.p.poll() and self.p.returncode > 0:
17+ text = _(" Error downloading [%s]") % (' '.join(cmd))
18+ logging.error(text)
19+ self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text)
20+ self.spin.stop()
21+ self.spin.hide()
22+ return
23+
24 time.sleep(1)
25
26 def stop(self):
27
28=== modified file 'testdrive/testdrive.py'
29--- testdrive/testdrive.py 2013-10-27 14:32:31 +0000
30+++ testdrive/testdrive.py 2014-09-12 17:17:43 +0000
31@@ -260,7 +260,7 @@
32
33 def get_proto(self):
34 if self.PROTO == "rsync":
35- cmd = "rsync -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO)
36+ cmd = "rsync --contimeout=5 --timeout=10 -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO)
37 return cmd
38 elif self.PROTO == "zsync" or self.PROTO == "http" or self.PROTO == "ftp":
39 if commands.getstatusoutput("which zsync")[0] == 0:

Subscribers

People subscribed via source and target branches