Bug 999967 - AttributeError: 'module' object has no attribute 'dumps'
Summary: AttributeError: 'module' object has no attribute 'dumps'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.14.2
Assignee: Amit Saha
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-22 13:17 UTC by Marian Ganisin
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-07 01:47:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Marian Ganisin 2013-08-22 13:17:12 UTC
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 14:26:53 UTC
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-03 01:13:48 UTC
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-03 03:22:54 UTC
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 07:58:18 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/2210/1

Comment 8 xjia 2013-09-05 06:30:13 UTC
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-03 02:28:49 UTC
Beaker 0.15 has been released.

Comment 10 Raymond Mancy 2013-10-23 01:57:17 UTC
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 06:36:11 UTC
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 12:53:32 UTC
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-07 01:47:07 UTC
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.