Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-19 Thread Joshua Harlow

Good find ;)

Davanum Srinivas wrote:

Josh,

Haha, see note from russellb :)
http://git.openstack.org/cgit/openstack/nova/tree/nova/network/rpcapi.py#n308

On Thu, Mar 17, 2016 at 6:44 PM, Joshua Harlow  wrote:

In a follow-up to this.

Seems like the patch to disable/disallow this itself found some 'violations'
@
http://logs.openstack.org/24/289624/3/check/gate-oslo.messaging-src-dsvm-full-amqp1-centos7/e3b485c/console.html.gz#_2016-03-11_00_06_56_177

Details: {u'message': u'Unable to associate floating IP 172.24.5.1 to fixed
IP 10.1.14.255 for instance 3660f872-a8c2-4469-99c3-062ed1a90131. Error:
Remote error: NoSuchMethod Endpoint does not support RPC method
_associate_floating_ip\n[u\'Traceback (most recent call last):\\n\', u\'
File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line
138, in _dispatch_and_reply\\nincoming.message))\\n\', u\' File
"/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line 170,
in _dispatch\\nraise NoSuchMethod(method)\\n\', u\'NoSuchMethod:
Endpoint does not support RPC method _associate_floating_ip\\n\'].',
u'code': 400}

I believe this is a nova error as the test name is
'tempest.api.compute.floating_ips.test_floating_ips_actions'

So I guess the question becomes, should we start warning using warnings.warn
(instead of raising a NoSuchMethod error) and at a later point in the future
stop using warnings.warn and switch to NoSuchMethod, giving people ample
enough time to stop dispatching into protected/private methods.

Thoughts?

-Josh

On 03/08/2016 09:43 AM, Joshua Harlow wrote:

Hi all,

As I was working through https://review.openstack.org/#/c/288719/ for
kevin benton to do some things with in neutron it came to my
understanding that this code (the dispatcher code that is) can dispatch
into nearly arbitrary callables of any object (or that is what it looks
like it can do):


https://github.com/openstack/oslo.messaging/blob/4.5.0/oslo_messaging/rpc/dispatcher.py#L169


So during this exploration of this code for the above review it made me
wonder if this is a feature or bug, or if we should at least close the
hole of allowing calling into nearly any endpoint method/attribute (even
non-callable ones to?).

So before doing much more of this (which I started in review
https://review.openstack.org/#/c/289624/) I wanted to see if people are
actually using this 'ability' (for lack of better words) to call into
private/protected methods before pursuing 289624 much more...

Thoughts?

-Josh


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev






__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-19 Thread Davanum Srinivas
Josh,

Haha, see note from russellb :)
http://git.openstack.org/cgit/openstack/nova/tree/nova/network/rpcapi.py#n308

On Thu, Mar 17, 2016 at 6:44 PM, Joshua Harlow  wrote:
> In a follow-up to this.
>
> Seems like the patch to disable/disallow this itself found some 'violations'
> @
> http://logs.openstack.org/24/289624/3/check/gate-oslo.messaging-src-dsvm-full-amqp1-centos7/e3b485c/console.html.gz#_2016-03-11_00_06_56_177
>
> Details: {u'message': u'Unable to associate floating IP 172.24.5.1 to fixed
> IP 10.1.14.255 for instance 3660f872-a8c2-4469-99c3-062ed1a90131. Error:
> Remote error: NoSuchMethod Endpoint does not support RPC method
> _associate_floating_ip\n[u\'Traceback (most recent call last):\\n\', u\'
> File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line
> 138, in _dispatch_and_reply\\nincoming.message))\\n\', u\' File
> "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", line 170,
> in _dispatch\\nraise NoSuchMethod(method)\\n\', u\'NoSuchMethod:
> Endpoint does not support RPC method _associate_floating_ip\\n\'].',
> u'code': 400}
>
> I believe this is a nova error as the test name is
> 'tempest.api.compute.floating_ips.test_floating_ips_actions'
>
> So I guess the question becomes, should we start warning using warnings.warn
> (instead of raising a NoSuchMethod error) and at a later point in the future
> stop using warnings.warn and switch to NoSuchMethod, giving people ample
> enough time to stop dispatching into protected/private methods.
>
> Thoughts?
>
> -Josh
>
> On 03/08/2016 09:43 AM, Joshua Harlow wrote:
>>
>> Hi all,
>>
>> As I was working through https://review.openstack.org/#/c/288719/ for
>> kevin benton to do some things with in neutron it came to my
>> understanding that this code (the dispatcher code that is) can dispatch
>> into nearly arbitrary callables of any object (or that is what it looks
>> like it can do):
>>
>>
>> https://github.com/openstack/oslo.messaging/blob/4.5.0/oslo_messaging/rpc/dispatcher.py#L169
>>
>>
>> So during this exploration of this code for the above review it made me
>> wonder if this is a feature or bug, or if we should at least close the
>> hole of allowing calling into nearly any endpoint method/attribute (even
>> non-callable ones to?).
>>
>> So before doing much more of this (which I started in review
>> https://review.openstack.org/#/c/289624/) I wanted to see if people are
>> actually using this 'ability' (for lack of better words) to call into
>> private/protected methods before pursuing 289624 much more...
>>
>> Thoughts?
>>
>> -Josh
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



-- 
Davanum Srinivas :: https://twitter.com/dims

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-19 Thread Joshua Harlow

On 03/18/2016 12:22 PM, Doug Hellmann wrote:

We need the warning to show up in the calling side, so if we can look
at the name there and emit the warning that would be a good start. Then
changing oslo.messaging to not allow calling private methods would be an
API break, and require raising the major version for that release of the
library.

Doug


Sounds good, I'll see what I can do.

Hopefully there are not to many more instances of this kind of calling 
into protected/private methods happening (outside of this one instance 
we see in nova).


-Josh

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-19 Thread Joshua Harlow

In a follow-up to this.

Seems like the patch to disable/disallow this itself found some 
'violations' @ 
http://logs.openstack.org/24/289624/3/check/gate-oslo.messaging-src-dsvm-full-amqp1-centos7/e3b485c/console.html.gz#_2016-03-11_00_06_56_177


Details: {u'message': u'Unable to associate floating IP 172.24.5.1 to 
fixed IP 10.1.14.255 for instance 3660f872-a8c2-4469-99c3-062ed1a90131. 
Error: Remote error: NoSuchMethod Endpoint does not support RPC method 
_associate_floating_ip\n[u\'Traceback (most recent call last):\\n\', u\' 
 File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", 
line 138, in _dispatch_and_reply\\nincoming.message))\\n\', u\' 
File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", 
line 170, in _dispatch\\nraise NoSuchMethod(method)\\n\', 
u\'NoSuchMethod: Endpoint does not support RPC method 
_associate_floating_ip\\n\'].', u'code': 400}


I believe this is a nova error as the test name is 
'tempest.api.compute.floating_ips.test_floating_ips_actions'


So I guess the question becomes, should we start warning using 
warnings.warn (instead of raising a NoSuchMethod error) and at a later 
point in the future stop using warnings.warn and switch to NoSuchMethod, 
giving people ample enough time to stop dispatching into 
protected/private methods.


Thoughts?

-Josh

On 03/08/2016 09:43 AM, Joshua Harlow wrote:

Hi all,

As I was working through https://review.openstack.org/#/c/288719/ for
kevin benton to do some things with in neutron it came to my
understanding that this code (the dispatcher code that is) can dispatch
into nearly arbitrary callables of any object (or that is what it looks
like it can do):

https://github.com/openstack/oslo.messaging/blob/4.5.0/oslo_messaging/rpc/dispatcher.py#L169


So during this exploration of this code for the above review it made me
wonder if this is a feature or bug, or if we should at least close the
hole of allowing calling into nearly any endpoint method/attribute (even
non-callable ones to?).

So before doing much more of this (which I started in review
https://review.openstack.org/#/c/289624/) I wanted to see if people are
actually using this 'ability' (for lack of better words) to call into
private/protected methods before pursuing 289624 much more...

Thoughts?

-Josh


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-19 Thread Doug Hellmann
Excerpts from Joshua Harlow's message of 2016-03-17 15:44:06 -0700:
> In a follow-up to this.
> 
> Seems like the patch to disable/disallow this itself found some 
> 'violations' @ 
> http://logs.openstack.org/24/289624/3/check/gate-oslo.messaging-src-dsvm-full-amqp1-centos7/e3b485c/console.html.gz#_2016-03-11_00_06_56_177
> 
> Details: {u'message': u'Unable to associate floating IP 172.24.5.1 to 
> fixed IP 10.1.14.255 for instance 3660f872-a8c2-4469-99c3-062ed1a90131. 
> Error: Remote error: NoSuchMethod Endpoint does not support RPC method 
> _associate_floating_ip\n[u\'Traceback (most recent call last):\\n\', u\' 
>   File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", 
> line 138, in _dispatch_and_reply\\nincoming.message))\\n\', u\' 
> File "/opt/stack/new/oslo.messaging/oslo_messaging/rpc/dispatcher.py", 
> line 170, in _dispatch\\nraise NoSuchMethod(method)\\n\', 
> u\'NoSuchMethod: Endpoint does not support RPC method 
> _associate_floating_ip\\n\'].', u'code': 400}
> 
> I believe this is a nova error as the test name is 
> 'tempest.api.compute.floating_ips.test_floating_ips_actions'
> 
> So I guess the question becomes, should we start warning using 
> warnings.warn (instead of raising a NoSuchMethod error) and at a later 
> point in the future stop using warnings.warn and switch to NoSuchMethod, 
> giving people ample enough time to stop dispatching into 
> protected/private methods.

We need the warning to show up in the calling side, so if we can look
at the name there and emit the warning that would be a good start. Then
changing oslo.messaging to not allow calling private methods would be an
API break, and require raising the major version for that release of the
library.

Doug

> 
> Thoughts?
> 
> -Josh
> 
> On 03/08/2016 09:43 AM, Joshua Harlow wrote:
> > Hi all,
> >
> > As I was working through https://review.openstack.org/#/c/288719/ for
> > kevin benton to do some things with in neutron it came to my
> > understanding that this code (the dispatcher code that is) can dispatch
> > into nearly arbitrary callables of any object (or that is what it looks
> > like it can do):
> >
> > https://github.com/openstack/oslo.messaging/blob/4.5.0/oslo_messaging/rpc/dispatcher.py#L169
> >
> >
> > So during this exploration of this code for the above review it made me
> > wonder if this is a feature or bug, or if we should at least close the
> > hole of allowing calling into nearly any endpoint method/attribute (even
> > non-callable ones to?).
> >
> > So before doing much more of this (which I started in review
> > https://review.openstack.org/#/c/289624/) I wanted to see if people are
> > actually using this 'ability' (for lack of better words) to call into
> > private/protected methods before pursuing 289624 much more...
> >
> > Thoughts?
> >
> > -Josh
> 

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-08 Thread Mehdi Abaakouk



So during this exploration of this code for the above review it made
me wonder if this is a feature or bug, or if we should at least close
the hole of allowing calling into nearly any endpoint method/attribute
(even non-callable ones to?).
...
Thoughts?


I agree that doesn't make any sense to call non-callable and 
protected/private methods.

So, I'm ok to seal the hole.

--
Mehdi Abaakouk
mail: sil...@sileht.net
irc: sileht

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [oslo] oslo.messaging dispatching into private/protected methods?

2016-03-08 Thread Joshua Harlow

Hi all,

As I was working through https://review.openstack.org/#/c/288719/ for 
kevin benton to do some things with in neutron it came to my 
understanding that this code (the dispatcher code that is) can dispatch 
into nearly arbitrary callables of any object (or that is what it looks 
like it can do):


https://github.com/openstack/oslo.messaging/blob/4.5.0/oslo_messaging/rpc/dispatcher.py#L169

So during this exploration of this code for the above review it made me 
wonder if this is a feature or bug, or if we should at least close the 
hole of allowing calling into nearly any endpoint method/attribute (even 
non-callable ones to?).


So before doing much more of this (which I started in review 
https://review.openstack.org/#/c/289624/) I wanted to see if people are 
actually using this 'ability' (for lack of better words) to call into 
private/protected methods before pursuing 289624 much more...


Thoughts?

-Josh

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev