<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 13 February 2015 at 17:16, John Belamaric <span dir="ltr"><<a href="mailto:jbelamaric@infoblox.com" target="_blank">jbelamaric@infoblox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><span class="">
<span>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
<br>
</div>
<div>Put it in this way, it also makes sense. But I think I need to see it translated in code to figure it out properly. Anyway, this is something which pertains the base classes rather than the reference driver.</div>
<div>I think from the perspective of the reference driver we should just raise if a "AnyAddressRequest" is sent for a subnet where addresses are supposed to be autogenerated, because the ipam driver won't generate the address.</div>
<div> </div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
</span><div>Makes sense.</div><span class="">
<div><br>
</div>
<span>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div><br>
</div>
<div>Hmm. How dynamic is Python? I know in Ruby I could do something like this at class load time:</div>
<div><br>
</div>
<div>config.use_ipam ? DbBasePluginV2 = IpamDbBasePluginV2 : DbBasePluginV2 = LegacyDbBasePluginV2</div>
<div><br>
</div>
<div>and all the subclasses would work fine as before...</div>
</div>
</blockquote>
<div><br>
</div>
<div>Technically yes.</div>
<div>From a practical perspective however if the subclass is assuming that create_port works in the "old" way, and then instead is working in the "ipam" way, it might be mayhem!</div>
<div> </div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
</span><div>Yes, certainly. But it provides a transition period for plugins to migrate to support the new IPAM model.</div></div></blockquote><div><br></div><div>I think we need to check Pavel's work on doing the plumbing for the IPAM driver to assess whether it would be more convenient to have an IPAM base class which extends and override DbBasePluginV2 or have 'ipam' versions of methods in such class. In the latter case the approach wouldn't be too different from the one you envisioned for classes, eg.:</div><div><br></div><div><br></div><div>if CONF.enable_ipam_drivers:<br></div><div> self.create_port = self.create_port_ipam</div><div><br></div><div>(otherwise self.create_port would be the same method that we have today)</div><div><br></div><div>Salvatore</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
</div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>