<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px;">
<div style="font-family: Calibri, sans-serif;">Hi All:</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div style="font-family: Calibri, sans-serif;">In digging thru this, yes with the neutron change, it changed the MRO as below and thus the issue. </div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<div>
<p style="font-family: Menlo; margin: 0px;">(<class 'neutron_fwaas.services.firewall.agents.varmour.varmour_router.vArmourL3NATAgent'>, <class 'neutron.agent.l3.agent.L3NATAgent'>, <class 'neutron.agent.l3.ha.AgentMixin'>, <class 'neutron.agent.l3.dvr.AgentMixin'>,
 <class 'neutron.manager.Manager'>, <class 'oslo_service.periodic_task.PeriodicTasks'>, </p>
<p style="margin: 0px;"><span style="font-family: Menlo;"><—— </span>the issue is at this point where we have a mismatch with args</p>
<p style="font-family: Menlo; margin: 0px;"><class 'neutron_fwaas.services.firewall.agents.l3reference.firewall_l3_agent.FWaaSL3AgentRpcCallback'>, <class 'neutron_fwaas.services.firewall.agents.firewall_agent_api.FWaaSAgentRpcCallbackMixin'>, <type 'object’>)</p>
<p style="font-family: Menlo; margin: 0px;"><br>
</p>
<p style="margin: 0px;">Nate, Margaret – thanks for digging thru this – lets get together during the day to discuss this more. Margaret, to answer ur question – it worked before due to a favorable ordering with the older hacked inheritance relationship. We
 can find a way to fix this in fwaas but more importantly need to get some missing pieces in to the Observer Hierarchy patch set as well.</p>
<p style="margin: 0px;"><br>
</p>
<p style="margin: 0px;">Thanks</p>
<p style="margin: 0px;"><br>
</p>
<p style="margin: 0px;">Sridar</p>
</div>
<div style="font-family: Calibri, sans-serif;"><br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-family: Calibri, sans-serif;">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Doug Wiegley <<a href="mailto:dougwig@parksidesoftware.com">dougwig@parksidesoftware.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, May 5, 2016 at 9:40 PM<br>
<span style="font-weight:bold">To: </span>OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [openstack-dev] [neutron][FWaaS] __init__ arguments issue status<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
This break is almost certainly because of the following neutron change, to unwind the incestuous inheritance that was in neutron (dependency arrow was circular):
<div class=""><br class="">
</div>
<div class=""><a href="https://review.openstack.org/#/c/223343/" class="">https://review.openstack.org/#/c/223343/</a></div>
<div class=""><br class="">
</div>
<div class="">I don’t expect there will be a lot of appetite to revert that, so it will need to be addressed in neutron-fwaas. Likely it should’ve had an ML warning first, sorry about that, this has been a longstanding issue.</div>
<div class=""><br class="">
</div>
<div class="">doug</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 5, 2016, at 7:00 PM, Frances, Margaret <<a href="mailto:Margaret_Frances@cable.comcast.com" class="">Margaret_Frances@cable.comcast.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Doug.  <br class="">
<br class="">
The old and new MROs are both pretty complicated, and it’s not entirely clear to me yet why the original one worked. (The MROs are included below for reading pleasure; they're embellished to show the incoming args to self’s init and outgoing args to super’s
 init in each case.)<br class="">
<br class="">
I’m fairly sure the APIs for the mixins can be made the same, and I’ll try that.  But I still wonder if in fact the problem is a base class ordering issue.  <br class="">
<br class="">
The error that 223343 produced occurs in method call #6 in the "AFTER" MRO, where we get the following trace:
<div class=""><br class="">
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><font face="Courier" class=""><span class="Apple-tab-span" style="white-space:pre"></span>super(PeriodicTasks, self).__init__()<br class="">
TypeError: __init__() takes exactly 2 arguments (1 given)</font></blockquote>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><br class="">
</blockquote>
<br class="">
For grins, we changed PeriodicTasks’s call to super init as suggested by the trace:</div>
<div class=""><br class="">
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class="">
<div class=""><font face="Courier" class=""><span class="Apple-tab-span" style="white-space:pre"></span>super(PeriodicTasks, self).__init__(conf)</font></div>
</blockquote>
<div class=""><br class="">
<br class="">
</div>
<div class="">At this point FWaaSAgentRpcCallbackMixin (AFTER, #8) complained:</div>
<div class=""><br class="">
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><font face="Courier" class=""><span class="Apple-tab-span" style="white-space: pre;"></span>super(FWaaSAgentRpcCallbackMixin, self).__init__(host)</font></blockquote>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><font face="Courier" class="">TypeError: object.__init__() takes no parameters</font></blockquote>
<br class="">
<br class="">
</div>
<div class="">Changing *that* class as suggested elicited the following (to me baffling) result:</div>
<div class="">
<div class=""><br class="">
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><font face="Courier" class=""><span class="Apple-tab-span" style="white-space:pre"></span>super(FWaaSAgentRpcCallbackMixin, self).__init__()</font></blockquote>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><font face="Courier" class="">TypeError: __init__() takes exactly 2 arguments (1 given)</font></blockquote>
<br class="">
<br class="">
</div>
<div class="">I find it baffling because FWaaSAgentRpcCallbackMixin is the end of the line, it’s a subclass of object, and object doesn’t allow arguments to init (so whose init is that? that’s the next thing I’m going to look at).  (It’s for these same reasons
 that I don’t understand why things worked before the 223343 change.)<br class="">
<br class="">
I’m still looking at things.  (And learning about MRO, which I’ve never really dealt with before.)  Will run pdb and see what surfaces.  <br class="">
<br class="">
Thanks for your help.  Thoughts, comments, suggestions all welcome.<br class="">
Margaret<br class="">
<br class="">
<br class="">
<font face="Courier" class="">BEFORE 223343<br class="">
 1. varmour_router_vArmourL3NATAgent <span class="Apple-tab-span" style="white-space:pre"></span>(host, conf)-->(host, conf)<br class="">
 2. agent_L3NATAgent <span class="Apple-tab-span" style="white-space:pre"> </span>
(host, conf)-->(conf)<br class="">
 3. firewall_l3_agent_FWaaSL3AgentRpcCallback <span class="Apple-tab-span" style="white-space:pre"></span>(conf)-->(host)<br class="">
 4. api_FWaaSAgentRpcCallbackMixin <span class="Apple-tab-span" style="white-space:pre"></span>(host)-->(host)<br class="">
 5. ha_AgentMixin<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(host)<br class="">
 6. dvr_AgentMixin<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(host)<br class="">
 7. manager_Manager<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(conf)<br class="">
 8. periodic_task_PeriodicTasks<span class="Apple-tab-span" style="white-space:pre"></span>(conf)-->()<br class="">
 9. firewall_l3_agent_FWaaSL3AgentRpcCallback<span class="Apple-tab-span" style="white-space:pre"></span>(conf)-->(host)<br class="">
10. api_FWaaSAgentRpcCallbackMixin<span class="Apple-tab-span" style="white-space:pre"></span>(host)-->(host)<br class="">
11. object<br class="">
<br class="">
AFTER 223343<br class="">
 1. varmour_router_vArmourL3NATAgent <span class="Apple-tab-span" style="white-space:pre"></span>(host, conf)-->(host, conf)<br class="">
 2. agent_L3NATAgent <span class="Apple-tab-span" style="white-space:pre"> </span>
(host, conf)-->(host)<br class="">
 3. ha_AgentMixin<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(host)<br class="">
 4. dvr_AgentMixin<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(host)<br class="">
 5. manager_Manager<span class="Apple-tab-span" style="white-space:pre"> </span>(host)-->(conf)<br class="">
 6. periodic_task_PeriodicTasks<span class="Apple-tab-span" style="white-space:pre"></span>(conf)-->()<br class="">
 7. firewall_l3_agent_FWaaSL3AgentRpcCallback <span class="Apple-tab-span" style="white-space:pre"></span>(conf)-->(host)<br class="">
 8. api_FWaaSAgentRpcCallbackMixin<span class="Apple-tab-span" style="white-space:pre"></span>(host)-->(host)<br class="">
 9. object</font><br class="">
<br class="">
<div class="">--<br class="">
Margaret Frances<br class="">
Eng 4, Prodt Dev Engineering<br class="">
<br class="">
<br class="">
</div>
<br class="">
<blockquote type="cite" class="">On May 5, 2016, at 7:06 PM, Doug Hellmann <<a href="mailto:doug@doughellmann.com" class="">doug@doughellmann.com</a>> wrote:<br class="">
<br class="">
Excerpts from Nate Johnston's message of 2016-05-05 17:40:13 -0400:<br class="">
<blockquote type="cite" class="">FWaaS team,<br class="">
<br class="">
After a day of looking at the tests currently failing in the FWaaS repo, I<br class="">
believe I have the issue narrowed down considerably. First, to restate what<br class="">
is going on.  If you check out the neutron-fwaas repository and run `tox -e<br class="">
py27` in it, you will get six errors all in the<br class="">
neutron_fwaas.tests.unit.services.firewall.agents.varmour.test_varmour_router.TestVarmourRouter<br class="">
section.<br class="">
Running the py34 tests results in similar problems.  The failures follow<br class="">
the following form:<br class="">
<br class="">
Captured traceback:<br class="">
<br class="">
~~~~~~~~~~~~~~~~~~~<br class="">
<br class="">
   Traceback (most recent call last):<br class="">
<br class="">
     File<br class="">
"neutron_fwaas/tests/unit/services/firewall/agents/varmour/test_varmour_router.py",<br class="">
line 190, in test_agent_external_gateway<br class="">
<br class="">
       router = self._create_router()<br class="">
<br class="">
     File<br class="">
"neutron_fwaas/tests/unit/services/firewall/agents/varmour/test_varmour_router.py",<br class="">
line 87, in _create_router<br class="">
<br class="">
       router = varmour_router.vArmourL3NATAgent(HOSTNAME, self.conf)<br class="">
<br class="">
     File<br class="">
"neutron_fwaas/services/firewall/agents/varmour/varmour_router.py", line<br class="">
54, in __init__<br class="">
<br class="">
       super(vArmourL3NATAgent, self).__init__(host, conf)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/agent.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/agent.py</a>",<br class="">
line 244, in __init__<br class="">
<br class="">
       super(L3NATAgent, self).__init__(host=self.conf.host)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/ha.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/ha.py</a>",<br class="">
line 93, in __init__<br class="">
<br class="">
       super(AgentMixin, self).__init__(host)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/dvr.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/dvr.py</a>",<br class="">
line 30, in __init__<br class="">
<br class="">
       super(AgentMixin, self).__init__(host)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/agent.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/agent/l3/agent.py</a>",<br class="">
line 70, in __init__<br class="">
<br class="">
       super(FWaaSAgentRpcCallbackMixin, self).__init__(host)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/manager.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/src/neutron/neutron/manager.py</a>",<br class="">
line 44, in __init__<br class="">
<br class="">
       super(Manager, self).__init__(conf)<br class="">
<br class="">
     File "/home/njohns002/<br class="">
<a href="http://github.com/openstack/neutron-fwaas-311159/.tox/py27/lib/python2.7/site-packages/oslo_service/periodic_task.py" class="">github.com/openstack/neutron-fwaas-311159/.tox/py27/lib/python2.7/site-packages/oslo_service/periodic_task.py</a>",<br class="">
line 177, in __init__<br class="">
<br class="">
       super(PeriodicTasks, self).__init__()<br class="">
<br class="">
   TypeError: __init__() takes exactly 2 arguments (1 given)<br class="">
<br class="">
I pinged the Oslo folks, and they were able to help me look into the issue,<br class="">
which cleared oslo.service of any role.  The change that introduced this is<br class="">
actually a neutron change - <a href="https://review.openstack.org/#/c/223343/" class="">
https://review.openstack.org/#/c/223343/</a> - and<br class="">
I could experimentally test for it by doing the following, which checks out<br class="">
the change before the problem one, "Remove BGP code from neutron".  At that<br class="">
point `tox -e py27` could complete successfully.<br class="">
<br class="">
Everything works with the older commit:   cd .tox/py27/src/neutron && git<br class="">
checkout fe702f8f2af265554c7ff6f464b99562f8c54254 && cd - && tox -e py27<br class="">
Things break with commit 223343:          cd .tox/py27/src/neutron && git<br class="">
checkout f31861843d90e013d31fb76fc576b49a35e218aa4  && cd - && tox -e py27<br class="">
<br class="">
My guess on this is that the reason for the breakage is due to multiple<br class="">
inheritance and the changing of the ancestry for the L3NATAgent object.  So<br class="">
the focus of my effort (with Margaret Frances providing crucial insight) is<br class="">
determining what precisely needs to be fixed or reverted to make this work,<br class="">
while in keeping with the removal of FWaaS code from Neutron.  I shall<br class="">
continue to look at this tomorrow, but if anyone wishes to pick up the<br class="">
torch and figure this out then you should feel free to do so.  If not, I<br class="">
shall resume tomorrow.<br class="">
<br class="">
Thanks,<br class="">
<br class="">
--N.<br class="">
</blockquote>
<br class="">
Based on looking at the class hierarchy for vArmourL3NATAgent, I think<br class="">
the problem is that the mixin classes up and down that hierarchy don't<br class="">
take the same arguments for __init__(). That's going to make using super()<br class="">
difficult. Normally one would just need to switch the order of the base<br class="">
classes so all of the mixins are initialized before the Manager and<br class="">
PeriodicTask base classes, but doing that doesn't fix the problem in<br class="">
this case.<br class="">
<br class="">
Is it possible to make all of the mixin APIs the same?<br class="">
<br class="">
Doug<br class="">
<br class="">
__________________________________________________________________________<br class="">
OpenStack Development Mailing List (not for usage questions)<br class="">
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org" class="">
OpenStack-dev-request@lists.openstack.org</a>?subject:unsubscribe<br class="">
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" class="">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br class="">
<br class="">
</blockquote>
<br class="">
</div>
</div>
</div>
</div>
__________________________________________________________________________<br class="">
OpenStack Development Mailing List (not for usage questions)<br class="">
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org" class="">
OpenStack-dev-request@lists.openstack.org</a>?subject:unsubscribe<br class="">
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" class="">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</span>
</body>
</html>