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
=== modified file 'bin/testdrive-gtk'
--- bin/testdrive-gtk 2013-11-17 08:19:27 +0000
+++ bin/testdrive-gtk 2014-09-12 17:17:43 +0000
@@ -860,6 +860,7 @@
860860
861 def run(self):861 def run(self):
862 cmd = self.command.split()862 cmd = self.command.split()
863 logging.debug("executing command `%s`", ' '.join(cmd))
863 self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines = True)864 self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines = True)
864 percent = re.compile(r'(\d+)%')865 percent = re.compile(r'(\d+)%')
865 self.status_label.show()866 self.status_label.show()
@@ -887,6 +888,14 @@
887 prev = match.group(1)888 prev = match.group(1)
888 text = _(" Downloading %s (%s%%)") % (os.path.basename(self.url).partition("_")[2], prev)889 text = _(" Downloading %s (%s%%)") % (os.path.basename(self.url).partition("_")[2], prev)
889 self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text)890 self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text)
891 if self.p and self.p.poll() and self.p.returncode > 0:
892 text = _(" Error downloading [%s]") % (' '.join(cmd))
893 logging.error(text)
894 self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text)
895 self.spin.stop()
896 self.spin.hide()
897 return
898
890 time.sleep(1)899 time.sleep(1)
891900
892 def stop(self):901 def stop(self):
893902
=== modified file 'testdrive/testdrive.py'
--- testdrive/testdrive.py 2013-10-27 14:32:31 +0000
+++ testdrive/testdrive.py 2014-09-12 17:17:43 +0000
@@ -260,7 +260,7 @@
260260
261 def get_proto(self):261 def get_proto(self):
262 if self.PROTO == "rsync":262 if self.PROTO == "rsync":
263 cmd = "rsync -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO)263 cmd = "rsync --contimeout=5 --timeout=10 -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO)
264 return cmd264 return cmd
265 elif self.PROTO == "zsync" or self.PROTO == "http" or self.PROTO == "ftp":265 elif self.PROTO == "zsync" or self.PROTO == "http" or self.PROTO == "ftp":
266 if commands.getstatusoutput("which zsync")[0] == 0:266 if commands.getstatusoutput("which zsync")[0] == 0:

Subscribers

People subscribed via source and target branches