#115 make json import consistent
Merged 7 years ago by mikem. Opened 7 years ago by mikem.
https://github.com/mikem23/koji-playground.git json-import  into  master

use python json, but fall back to simplejson
Mike McLean • 7 years ago  
hub/kojihub.py
file modified
+6 -1
@@ -45,7 +45,6 @@

  import re

  import rpm

  import shutil

- import simplejson as json

  import stat

  import subprocess

  import sys
@@ -57,6 +56,12 @@

  import zipfile

  from koji.context import context

  

+ try:

+     import json

+ except ImportError:

+     import simplejson as json

+ 

+ 

  logger = logging.getLogger('koji.hub')

  

  def log_error(msg):

koji.spec
file modified
+3
@@ -47,6 +47,9 @@

  Requires: httpd

  Requires: mod_wsgi

  Requires: postgresql-python

+ %if 0%{?rhel} == 5

+ Requires: python-simplejson

+ %endif

  Requires: %{name} = %{version}-%{release}

  

  %description hub

no initial comment

Use built in json module and fall back to simplejson. Require python-simplejson on rhel5.

I'm surprised this hasn't been merged yet. It's rather trivial...

Wasn't in a hurry, giving folks a chance to review.

I honestly think we should drop RHEL 5 support at this time and focus on rhel 6 on. given that RHEL 5 is End of Production and EPEL will drop support on March 31 2017. Signed repos will not work on RHEL 5. we can ensure that the current version for rhel5 continues to work with new hub versions.

ausil, not ready to do that quite yet, but maybe soon we can relegate rhel5 support to a separate branch (which I think we'll have to do for py3). However, that's all a bit beyond of the scope of this simple change. Are you objecting?

Commit 7c0df57 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

7 years ago
Metadata