From a56a352e92b8a5fc06e83e91aa97994071f1742b Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Wed, 16 Oct 2013 01:33:40 -0700 Subject: Fix IndexError for zero length search results. --- mirrorselect/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mirrorselect') diff --git a/mirrorselect/main.py b/mirrorselect/main.py index 45cc30b..6a9c43d 100755 --- a/mirrorselect/main.py +++ b/mirrorselect/main.py @@ -427,6 +427,9 @@ class MirrorSelect(object): else: urls = self.select_urls(hosts, options) - self.write_config(fsmirrors + urls, options.output, - config_path, options.rsync) - + if len(urls): + self.write_config(fsmirrors + urls, options.output, + config_path, options.rsync) + else: + self.output.write("No search results found. " + "Check your filter settings and re-run mirrorselect\n") -- cgit v1.2.3-65-gdbad