<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 29, 2013 at 5:51 AM, Thierry Carrez <span dir="ltr"><<a href="mailto:thierry@openstack.org" target="_blank">thierry@openstack.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">John Garbutt wrote:<br>
> I tend to agree that (option 3) aggregating all of the calls to<br>
> rootwrap may be impractical:<br>
>> Sean Dague wrote:<br>
>> The reason there are 20 different call outs is that they aren't all in the<br>
>> same place. There are phases that happen here, and different kind of errors<br>
>> needed. I'm skeptical that you could push it all into one place.<br>
><br>
> However it seems like the quickest way to reduce _some_ of the impact.<br>
><br>
> Maybe just have python command-lets, like the filters (python code<br>
> that runs as root) that chain a set of shell requests, and the input<br>
> is restricted by the filters in the usual way. I do worry that it<br>
> encourages larger chunks of code running as root, but that is<br>
> something we should be able to avoid.<br>
<br>
</div>Running Python snippets instead of shelling out has been on the rootwrap<br>
feature backlog for a while. The drawback is that you lose "sudo"<br>
backward compat (the ability to run the same command using plain "sudo"<br>
instead of "sudo rootwrap...") so we were kinda waiting for a good use<br>
case justifying such loss.<br>
<br>
However if the run_as_root calls are scattered around and can't be<br>
grouped with minimal logic that will not give us a lot compared to using<br>
shell scripts for aggregation.<br>
<br>
Could someone post a log of the 20 calls involved so that we could check<br>
out how they could be grouped ? It doesn't have to be all in one call,<br>
even reducing those 20 to 5 or 10 would bring a significant performance<br>
improvement.<br></blockquote><div><br></div><div><br></div><div><div>$ git grep "as_root=True" nova/network/linux_net.py | wc -l</div><div>66</div></div><div><br></div><div>Sure we can group some calls together, but then we have to move much of the logic into whatever mechanism we are using to grouping calls together.  For example see <a href="https://github.com/openstack/nova/blob/master/nova/network/linux_net.py#L783">https://github.com/openstack/nova/blob/master/nova/network/linux_net.py#L783</a></div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
--<br>
Thierry Carrez (ttx)<br>
</font></span><div class=""><div class="h5"><br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</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>
</div></div></blockquote></div><br></div></div>