From 71c50a21fbb21f91253b552c3fbd9b7956261b69 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 11 Dec 2014 09:06:47 -0600 Subject: Don't blow up if lastsync file wasn't correctly fetched Instead, pass None value in which is handled accordingly. Signed-off-by: Dan McGee --- mirrors/management/commands/mirrorcheck.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index d2a27bee..8c17c78f 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -96,7 +96,7 @@ def parse_lastsync(log, data): try: parsed_time = datetime.utcfromtimestamp(int(data)) log.last_sync = parsed_time.replace(tzinfo=utc) - except ValueError: + except (TypeError, ValueError): # it is bad news to try logging the lastsync value; # sometimes we get a crazy-encoded web page. # if we couldn't parse a time, this is a failure. @@ -197,8 +197,11 @@ def check_rsync_url(mirror_url, location, timeout): log.duration = None else: logger.debug("success: %s, %.2f", url, log.duration) - with open(lastsync_path, 'r') as lastsync: - parse_lastsync(log, lastsync.read()) + if os.path.exists(lastsync_path): + with open(lastsync_path, 'r') as lastsync: + parse_lastsync(log, lastsync.read()) + else: + parse_lastsync(log, None) finally: if os.path.exists(lastsync_path): os.unlink(lastsync_path) -- cgit v1.2.3 From fe75e44d4c9cd1944a332ffe87645aa1cc692255 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 17 Dec 2014 22:59:10 -0600 Subject: Fix thinko in leaving old code behind in keys_json Signed-off-by: Dan McGee --- public/views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/views.py b/public/views.py index c0dae400..7dd0528c 100644 --- a/public/views.py +++ b/public/views.py @@ -142,8 +142,6 @@ def keys_json(request): users = User.objects.filter( is_active=True, userprofile__id__in=profile_ids).select_related( 'userprofile__pgp_key').order_by('first_name', 'last_name') - - users = User.objects.filter(is_active=True).select_related('userprofile') node_list = [{ 'name': user.get_full_name(), 'key': user.userprofile.pgp_key, -- cgit v1.2.3 From 0bd67a57a9f735775682474ae1abb4932b948670 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 3 Jan 2015 11:15:20 -0600 Subject: Update several requirements Signed-off-by: Dan McGee --- requirements.txt | 9 +++++---- requirements_prod.txt | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2a5dba96..80439a7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,12 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.7.1 +Django==1.7.2 IPy==0.81 Jinja2==2.7.3 Markdown==2.5.2 +MarkupSafe==0.23 bencode==1.0 django-jinja==1.0.5 -django_countries==3.0.1 -jsmin==2.0.11 +django_countries==3.0.2 +jsmin==2.1.0 pgpdump==1.5 -pytz>=2014.7 +pytz>=2014.10 diff --git a/requirements_prod.txt b/requirements_prod.txt index 6edfa17f..619aa505 100644 --- a/requirements_prod.txt +++ b/requirements_prod.txt @@ -1,14 +1,15 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.7.1 +Django==1.7.2 IPy==0.81 Jinja2==2.7.3 Markdown==2.5.2 +MarkupSafe==0.23 bencode==1.0 django-jinja==1.0.5 -django_countries==3.0.1 -jsmin==2.0.11 +django_countries==3.0.2 +jsmin==2.1.0 pgpdump==1.5 psycopg2==2.5.4 pyinotify==0.9.4 python-memcached==1.53 -pytz>=2014.7 +pytz>=2014.10 -- cgit v1.2.3 From 8b22613dd5a85396155aaabef64902ed9e469ad0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 3 Jan 2015 20:41:54 -0600 Subject: Add lower bounds for bad compression report Packages smaller than 25 KiB shouldn't really come into play here; this was meant to show huge packages spending too much time on compression. Signed-off-by: Dan McGee --- devel/reports.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devel/reports.py b/devel/reports.py index ca1a3321..66fbd627 100644 --- a/devel/reports.py +++ b/devel/reports.py @@ -48,7 +48,8 @@ def big(packages, username): def badcompression(packages, username): cutoff = 0.90 * F('installed_size') - packages = packages.filter(compressed_size__gt=0, installed_size__gt=0, + packages = packages.filter(compressed_size__gt=25*1024, + installed_size__gt=25*1024, compressed_size__gte=cutoff).order_by('-compressed_size') # Format the compressed and installed sizes with MB/GB/etc suffixes @@ -153,11 +154,10 @@ REPORT_BIG = DeveloperReport('big', 'Big', ['compressed_size_pretty', 'installed_size_pretty']) REPORT_BADCOMPRESS = DeveloperReport('badcompression', 'Bad Compression', - 'Packages with a compression ratio of less than 10%', badcompression, + 'Packages > 25 KiB with a compression ratio < 10%', badcompression, ['Compressed Size', 'Installed Size', 'Ratio', 'Type'], ['compressed_size_pretty', 'installed_size_pretty','ratio', 'compress_type']) - REPORT_MAN = DeveloperReport('uncompressed-man', 'Uncompressed Manpages', 'Packages with uncompressed manpages', uncompressed_man) -- cgit v1.2.3 From 49596f75b749fa3d8e00f0d99ad639cfbee42b61 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 11 Jan 2015 17:11:15 -0600 Subject: Bump to latest pyinotify version Signed-off-by: Dan McGee --- requirements_prod.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_prod.txt b/requirements_prod.txt index 619aa505..8a1bd5f9 100644 --- a/requirements_prod.txt +++ b/requirements_prod.txt @@ -10,6 +10,6 @@ django_countries==3.0.2 jsmin==2.1.0 pgpdump==1.5 psycopg2==2.5.4 -pyinotify==0.9.4 +pyinotify==0.9.5 python-memcached==1.53 pytz>=2014.10 -- cgit v1.2.3 From 1edc33fd73ba588dea8765cd2d9a936f98d7dc1e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 13 Jan 2015 17:58:01 -0600 Subject: Bump to latest Django 1.7.x release Signed-off-by: Dan McGee --- requirements.txt | 2 +- requirements_prod.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 80439a7d..54cf90f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.7.2 +Django==1.7.3 IPy==0.81 Jinja2==2.7.3 Markdown==2.5.2 diff --git a/requirements_prod.txt b/requirements_prod.txt index 8a1bd5f9..ac528ef9 100644 --- a/requirements_prod.txt +++ b/requirements_prod.txt @@ -1,5 +1,5 @@ -e git+git://github.com/fredj/cssmin.git@master#egg=cssmin -Django==1.7.2 +Django==1.7.3 IPy==0.81 Jinja2==2.7.3 Markdown==2.5.2 -- cgit v1.2.3