Bug 587671 - qpid python client (low level api) "Connection instance has no attribute 'spec'"
Summary: qpid python client (low level api) "Connection instance has no attribute 'spec'"
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid
Version: Development
Hardware: All
OS: Linux
high
medium
Target Milestone: 1.3
: ---
Assignee: Rafael H. Schloming
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Keywords:
Depends On: 600256
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-30 14:15 UTC by Frantisek Reznicek
Modified: 2015-11-16 01:12 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2011-07-14 18:01:18 UTC


Attachments (Terms of Use)
The testing client (functional on qpid 0.5 version) (2.84 KB, application/x-tbz)
2010-04-30 14:15 UTC, Frantisek Reznicek
no flags Details

Description Frantisek Reznicek 2010-04-30 14:15:19 UTC
Created attachment 410489 [details]
The testing client (functional on qpid 0.5 version)

Description of problem:

There is observed change in the python low level API between last stable (0.5 qpid release) and current (qpid 0.7 candidate)

Python code snippet:

  if host is None:
      host = "localhost"

  self.sessionID = "rhts_%s.%d_%s_{%s}" % \
              (os.uname()[1], os.getpid(), sid, str(time.localtime()))
  self.conn = Connection( connect(host, port),
                          username=uname, password = passwd )
  # starting connection with timeout
  self.conn.start(timeout=self.timeout)
  # creating session with timeout
  #self.session = self.conn.session(self.sessionID)
  self.session = self.conn.session(name=self.sessionID, timeout=self.timeout)
>>self.mclient = managementClient(self.conn.spec)
  self.mchannel = self.mclient.addChannel(self.session)


Causes following Attribute Error:
Traceback (most recent call last):
  File "bz456272.py", line 125, in ?
    aq.append(AddQueue(i, quid[i]))
  File "bz456272.py", line 42, in __init__
    self.mgr.Connect("localhost", 5672, sid=id)
  File "rhtslib_management.py", line 55, in Connect
    self.mclient = managementClient(self.conn.spec)
AttributeError: Connection instance has no attribute 'spec'

Questions:
1] Could you evaluate the change effect on existing code around (the world)
   and summarize that this change is intended, please?
2] Could you review whether release note will be necessary if change is intended, please?
3] Could you suggest workaround for existing application[s], please?



Version-Release number of selected component (if applicable):
python-qpid-0.7.934605-1.el5
qpid-cpp-client-0.7.935473-1.el5
qpid-cpp-client-devel-0.7.935473-1.el5
qpid-cpp-client-devel-docs-0.7.935473-1.el5
qpid-cpp-client-ssl-0.7.935473-1.el5
qpid-cpp-mrg-debuginfo-0.7.929717-1.el5
qpid-cpp-server-0.7.935473-1.el5
qpid-cpp-server-cluster-0.7.935473-1.el5
qpid-cpp-server-devel-0.7.935473-1.el5
qpid-cpp-server-ssl-0.7.935473-1.el5
qpid-cpp-server-store-0.7.935473-1.el5
qpid-cpp-server-xml-0.7.935473-1.el5
qpid-java-client-0.7.934605-1.el5
qpid-java-common-0.7.934605-1.el5
qpid-tools-0.7.934605-2.el5


How reproducible:
100%

Steps to Reproduce:
1. run broker
2. launch the attached client against the broker
3. see the Attribute error
  
Actual results:
Client does not run, because of slight change in the API.

Expected results:
Client should run (modified or untouched depends on issue review done by devel).

Additional info:

Comment 1 Rafael H. Schloming 2010-05-07 14:52:49 UTC
This is a deliberate change, you can't customize what spec is used anymore. I believe this should work if you simply don't pass the spec to managementClient, i.e. use managementClient() instead.

We should definitely release note this.

Comment 2 Frantisek Reznicek 2010-05-11 08:41:24 UTC
I confirm that suggested change
 - self.mclient = managementClient(self.conn.spec)
 + self.mclient = managementClient()
is currently working on RHEL 4.8 / 5.5 i386 / x86_64 on package set listed above.

I'm keeping bug in it's state, presence of appropriate note in MRG release note is then enough to put in VERI, because as described in above post change is intended.

Comment 3 Gordon Sim 2010-06-04 09:53:57 UTC
BZ raised for release note: https://bugzilla.redhat.com/show_bug.cgi?id=600256


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