2016-01-27 01:07:12 |
Eva Balycheva |
bug |
|
|
added bug |
2016-01-27 01:08:56 |
Eva Balycheva |
description |
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch, the function causes exceptions for two reasons:
Reason 1:
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Reason 2:
'parent' object in this function is a Queue, but must be Client. When the problem in Reason 1 is fixed, see the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 84, in list_subscriptions
'options': {'haha': 'hehe'}})
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 66, in update
req, trans = self.client._request_and_transport()
AttributeError: 'Queue' object has no attribute '_request_and_transport'
Final solution:
Should the function to look like this:
def create_object(parent):
return lambda kwargs: Subscription(parent.client, kwargs.pop('source'),
subscriber=kwargs.pop('subscriber'),
ttl=kwargs.pop('ttl'),
id=kwargs.pop('id'),
auto_create=False,
**kwargs) |
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch, the function causes exceptions for two reasons:
Reason 1:
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Reason 2:
'parent' object in this function is a Queue, but must be Client. When the problem in Reason 1 is fixed, see the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 104, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 83, in list_subscriptions
sub.update({'subscriber': 'http://trigger.ok', 'ttl': 1000, 'options': {'haha': 'hehe'}})
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 66, in update
req, trans = self.client._request_and_transport()
AttributeError: 'Queue' object has no attribute '_request_and_transport'
Final solution:
Should the function to look like this:
def create_object(parent):
return lambda kwargs: Subscription(parent.client, kwargs.pop('source'),
subscriber=kwargs.pop('subscriber'),
ttl=kwargs.pop('ttl'),
id=kwargs.pop('id'),
auto_create=False,
**kwargs) |
|
2016-01-27 01:09:29 |
Eva Balycheva |
python-zaqarclient: assignee |
|
Eva Balycheva (ubershy) |
|
2016-01-27 01:37:21 |
Eva Balycheva |
description |
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch, the function causes exceptions for two reasons:
Reason 1:
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Reason 2:
'parent' object in this function is a Queue, but must be Client. When the problem in Reason 1 is fixed, see the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 104, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 83, in list_subscriptions
sub.update({'subscriber': 'http://trigger.ok', 'ttl': 1000, 'options': {'haha': 'hehe'}})
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 66, in update
req, trans = self.client._request_and_transport()
AttributeError: 'Queue' object has no attribute '_request_and_transport'
Final solution:
Should the function to look like this:
def create_object(parent):
return lambda kwargs: Subscription(parent.client, kwargs.pop('source'),
subscriber=kwargs.pop('subscriber'),
ttl=kwargs.pop('ttl'),
id=kwargs.pop('id'),
auto_create=False,
**kwargs) |
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch with some fixes, the function causes exception.
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name' |
|
2016-01-27 02:25:40 |
Eva Balycheva |
description |
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch with some fixes, the function causes exception.
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name' |
Problem 1:
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch with some fixes, the function causes exception.
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Problem 2:
See this: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/client.py#L79
I think this is not good, let's not modify response from Zaqar. This can add big confusion to the other developers, for example for the creator of the https://review.openstack.org/#/c/269398/ patch.
Problem 3:
This problem is only possible because of problems 1 and 2.
See: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/tests/queues/subscriptions.py#L123
This response body from Zaqar does not represent real response which is bad. It is missing 'source' key-value pair for each subscription in the body. |
|
2016-01-27 02:40:18 |
Eva Balycheva |
description |
Problem 1:
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly. When it is used by https://review.openstack.org/#/c/269398/ patch with some fixes, the function causes exception.
The response from Zaqar server during subscription listing doesn't contain 'queue_name' key in each subscription. Instead it is called 'source'. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Problem 2:
See this: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/client.py#L79
I think this is not good, let's not modify response from Zaqar. This can add big confusion to the other developers, for example for the creator of the https://review.openstack.org/#/c/269398/ patch.
Problem 3:
This problem is only possible because of problems 1 and 2.
See: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/tests/queues/subscriptions.py#L123
This response body from Zaqar does not represent real response which is bad. It is missing 'source' key-value pair for each subscription in the body. |
Problem 1(core problem):
See this: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/client.py#L79
I think this is not good, let's not modify response from Zaqar.
The queue name information is already under the key 'source'. There's no need for adding duplicate 'queue_name' key.
This can add big confusion to the other developers, for example for the creator of the https://review.openstack.org/#/c/269398/ patch. It also makes it possible to write not very good unit tests.
Problem 2:
This problem is only possible because of problem 1.
See this function: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/queues/v2/subscription.py#L78
I think it's written incorrectly, it just made to work with the code listed in Problem 1.
When the function is used by https://review.openstack.org/#/c/269398/ patch where response from Zaqar is not modified (which is sane), the function causes an exception. See the log:
Traceback (most recent call last):
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 105, in <module>
list_subscriptions()
File "/home/yell/Sync/Repos/OHMY!/ohmy.py", line 80, in list_subscriptions
for sub in queue.subscriptions():
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v1/iterator.py", line 106, in __next__
return self._create_function(args)
File "/home/yell/Sync/Repos/python-zaqarclient/zaqarclient/queues/v2/subscription.py", line 79, in <lambda>
return lambda kwargs: Subscription(parent, kwargs.pop("queue_name"),
KeyError: 'queue_name'
Problem 3:
This problem is only possible because of problem 1.
See: https://github.com/openstack/python-zaqarclient/blob/master/zaqarclient/tests/queues/subscriptions.py#L123
This response body from Zaqar does not represent real response which is bad. It is missing 'source' key-value pair for each subscription in the body. |
|
2016-01-27 02:41:50 |
Eva Balycheva |
summary |
Subscriptions listing does not work |
Subscriptions listing is not written good and causes many potential and real problems. |
|
2016-01-27 05:40:06 |
OpenStack Infra |
python-zaqarclient: status |
New |
In Progress |
|
2016-01-28 02:36:52 |
Feilong Wang |
python-zaqarclient: importance |
Undecided |
Medium |
|
2016-01-28 02:36:52 |
Feilong Wang |
python-zaqarclient: status |
In Progress |
Confirmed |
|
2016-02-15 21:27:31 |
OpenStack Infra |
python-zaqarclient: status |
Confirmed |
Fix Released |
|