From ace95f6e53f41409568d4e4f1cf4c2a69d931e2c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Mar 2013 21:38:58 -0600 Subject: Don't add blank options to rsync command line Rsync doesn't like this so much: Unexpected remote arg: rsync://mirror.example.com/archlinux/lastsync rsync error: syntax or usage error (code 1) at main.c(1214) [sender=3.0.9] Signed-off-by: Dan McGee --- mirrors/management/commands/mirrorcheck.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index f133c78..1315a01 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -169,7 +169,11 @@ def check_rsync_url(mirror_url, location, timeout): ipopt = '--ipv4' lastsync_path = os.path.join(tempdir, 'lastsync') rsync_cmd = ["rsync", "--quiet", "--contimeout=%d" % timeout, - "--timeout=%d" % timeout, ipopt, url, lastsync_path] + "--timeout=%d" % timeout] + if ipopt: + rsync_cmd.append(ipopt) + rsync_cmd.append(url) + rsync_cmd.append(lastsync_path) try: with open(os.devnull, 'w') as devnull: logger.debug("rsync cmd: %s", ' '.join(rsync_cmd)) -- cgit v1.2.3-24-g4f1b