Bug 999967 - AttributeError: 'module' object has no attribute 'dumps'
AttributeError: 'module' object has no attribute 'dumps'
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: command line (Show other bugs)
0.14
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.14.2
: ---
Assigned To: Amit Saha
tools-bugs
: Regression, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 09:17 EDT by Marian Ganisin
Modified: 2018-02-05 19:41 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-06 20:47:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marian Ganisin 2013-08-22 09:17:12 EDT
Description of problem:

$ bkr job-list --mine -l 12
Traceback (most recent call last):
  File "/usr/bin/bkr", line 8, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/bkr/client/main.py", line 50, in main
    return cmd.run(*cmd_args, **cmd_opts.__dict__)
  File "/usr/lib/python2.4/site-packages/bkr/client/commands/cmd_job_list.py", line 232, in run
    print json.dumps(jobs)
AttributeError: 'module' object has no attribute 'dumps'


Version-Release number of selected component (if applicable):
beaker-client-0.14.1-1.el5
python-2.4.3-56.el5
python-json-3.4-3.el5ipa
python-simplejson-2.0.9-8.el5
Comment 2 Marian Ganisin 2013-08-22 10:26:53 EDT
I forgot to mention rpm package of json module:

$ rpm -qf /usr/lib/python2.4/site-packages/json.py
python-json-3.4-3.el5ipa

Btw I had to solve same issue, here is ugly but efficient hack:

try:
    import json
except:
    import simplejson as json
if not 'loads' in dir(json):
    json.loads = json.read
if not 'dumps' in dir(json):
    json.dumps = json.write
Comment 3 Nick Coghlan 2013-09-02 21:13:48 EDT
The beaker server and client packages no longer support Python 2.4 (and hence no longer support RHEL5). Only the test harness still supports running on anything earlier than Python 2.6.
Comment 4 Nick Coghlan 2013-09-02 23:22:54 EDT
dcallagh pointed out we *do* technically still support RHEL5 for beaker-client. It's only the server and lab controller components that are RHEL6+ only.

Regressions in the Python 2.4 support are currently quite likely, however, since the *test suite* doesn't support Python 2.4.
Comment 5 Amit Saha 2013-09-04 03:58:18 EDT
On Gerrit: http://gerrit.beaker-project.org/#/c/2210/1
Comment 8 xjia 2013-09-05 02:30:13 EDT
Verify:

[root@dhcp-65-36 ~]# bkr job-list --mine -l 12
["J:1322", "J:1321", "J:1320", "J:1319", "J:1318", "J:1281", "J:1280", "J:1279", "J:1278", "J:1250", "J:1246", "J:1245"]
[root@dhcp-65-36 ~]# rpm -qa | grep beaker 
beaker-client-0.14.1-1.git.90.2142b35.el5
beaker-0.14.1-1.git.90.2142b35.el5
[root@dhcp-65-36 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
[root@dhcp-65-36 ~]# python 
Python 2.4.3 (#1, Oct 23 2012, 22:02:41) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Comment 9 Nick Coghlan 2013-10-02 22:28:49 EDT
Beaker 0.15 has been released.
Comment 10 Raymond Mancy 2013-10-22 21:57:17 EDT
This change has been nominated to be back ported to the 0.14 branch, to be released as part of the next maintenance release 0.14.2.
Comment 11 Nick Coghlan 2013-10-25 02:36:11 EDT
Adjusting target milestone to make the changes backported to 0.14.2 easier to identify. 0.15.0 has enough significant regressions that it shouldn't be used, so the change means that 0.15.1 can be effectively reidentified as the union of that tag and the 0.14.2 target milestone.
Comment 13 xjia 2013-10-31 08:53:32 EDT
Verify:

[root@dhcp-65-92 Desktop]#  bkr job-list --mine -l 12
["J:1918", "J:1903", "J:1891", "J:1890", "J:1886", "J:1885", "J:1884", "J:1882", "J:1879", "J:1878", "J:1877", "J:1868"]
[root@dhcp-65-92 Desktop]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
[root@dhcp-65-92 Desktop]# rpm -qa | grep beaker
beaker-client-0.14.2-1.el5
beaker-0.14.2-1.el5
[root@dhcp-65-92 Desktop]# rpm -qa | grep ^python-2
python-2.4.3-56.el5
Comment 14 Nick Coghlan 2013-11-06 20:47:07 EST
Closing as addressed in Beaker 0.14.2.

Note You need to log in before you can comment on or make changes to this bug.