Hi Everyone,<div>   i've been looking through wsgi code, and i have found a lot of duplicated code between all the projects. Running a quick and dirty search, i get the following numbers (just focusing on glance  horizon  keystone  nova  openstack-common  quantum  swift projects):</div>
<div>- There are 87 classes defined, but only "40 different". Rough numbers: (Number of times the class appears)</div><div><div>      6 Request</div><div>      5 Server</div><div>      5 Router</div><div>      5 Middleware</div>
<div>      5 Debug</div><div>      4 WritableLogger</div><div>      3 XMLDictSerializer</div><div>      3 XMLDeserializer</div><div>      3 TextDeserializer</div><div>      3 Resource</div><div>      3 JSONDictSerializer</div>
<div>      3 JSONDeserializer</div><div>      3 DictSerializer</div><div>      3 Application</div><div>      3 ActionDispatcher</div><div>      2 ResponseSerializer</div><div>      2 RequestHeadersDeserializer</div><div>      2 RequestDeserializer</div>
<div>      2 Fault</div><div>      2 Controller</div></div><div><br></div><div>And some of them only defined and used once: (some are the same with different name like  ResponseHeader<b>s</b>Serializer and ResponseHeaderSerializer)</div>
<div><div>      1 WSGIContext</div><div>      1 Serializer</div><div>      1 ResponseObject</div><div>      1 ResponseHeadersSerializer</div><div>      1 ResponseHeaderSerializer</div><div>      1 ResourceExceptionHandler</div>
<div>      1 Resource</div><div>      1 OverLimitFault</div><div>      1 MetadataXMLDeserializer</div><div>      1 Loader</div><div>      1 JSONResponseSerializer</div><div>      1 JSONRequestDeserializer</div><div>      1 FilterFactory</div>
<div>      1 ExtensionRouter</div><div>      1 ControllerMetaclass</div><div>      1 ComposingRouter</div><div>      1 ComposableRouter</div><div>      1 BasePasteFactory</div><div>      1 BaseApplication</div><div>      1 AppFactory</div>
</div><div><br></div><div>Running a code analysis duplication tool like <a href="http://clonedigger.sourceforge.net/">http://clonedigger.sourceforge.net/</a>, the numbers and mostly the same: around 45% of the code is duplicated (A full output is available at <a href="http://debostack.org/paste/wsgi.html">http://debostack.org/paste/wsgi.html</a>). I think there are a lot improvements we can get here using openstack-common as the base for all the wsgi code. (As Adam Young reported[1], services can be migrated to use HTTPD, but quantum[2] have some issues. Using the same code, the solution should be the same in all projects). I will open a blueprint for this and update the info as much as possible.</div>
<div><br></div><div>[1] - <a href="http://adam.younglogic.com/2012/03/keystone-should-move-to-apache-httpd/">http://adam.younglogic.com/2012/03/keystone-should-move-to-apache-httpd/</a></div><div>[2] - <a href="https://lists.launchpad.net/openstack/msg09966.html">https://lists.launchpad.net/openstack/msg09966.html</a></div>
<div><br></div><div><br>-- <br><div align="left"><div><font style="font-size:14px"><span lang="ES" style="font-family:Arial">Ghe Rivero<br></span></font><font face="Arial" size="2" style="font-family:arial,helvetica,sans-serif"><font><b>OpenStack & Distribution Engineer<br>
</b></font></font><span style="border-collapse:separate;font-size:medium;font-family:Times"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"></span></span><b style="font-size:14px"><font face="Arial" size="2" style="font-family:arial,helvetica,sans-serif"><a href="http://www.stackops.com/" style="color:rgb(17,85,204)" target="_blank"><b>www.stackops.com</b></a> | </font></b><font face="Arial" size="2" style="font-size:14px;font-family:arial,helvetica,sans-serif"><font size="1"> <a href="mailto:diego.parrilla@stackops.com" style="color:rgb(17,85,204)" target="_blank">ghe.rivero@stackops.com</a></font></font><span style="border-collapse:separate;font-size:medium;font-family:Times"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#004438" face="Arial"><b><b><span lang="EN-GB" style="font-size:10pt"></span></b></b></font></span></span><font face="Arial" size="2" style="font-size:14px;font-family:arial,helvetica,sans-serif"><font size="1"> | </font></font><span style="border-collapse:separate;font-size:medium;font-family:Times"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font face="Arial" size="2" style="font-family:arial,helvetica,sans-serif"><font size="1"><a value="+34649944329" style="color:rgb(17,85,204)">+34 625 63 45 23 </a>| <a style="color:rgb(17,85,204)">skype:ghe.rivero</a></font></font></span></span><font face="Arial" size="2" style="font-size:14px;font-family:arial,helvetica,sans-serif"><a href="http://www.stackops.com/" style="color:rgb(17,85,204)" target="_blank"><b><br>
</b></a></font></div></div><div><font color="#004438" face="Arial"><b><p><span style="border-collapse:separate;font-size:medium;font-family:Times"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><span style="border-collapse:separate;font-size:medium;font-family:Times"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#004438" face="Arial"><b><b><span lang="EN-GB" style="font-size:10pt"><img src="http://stackops.s3-external-3.amazonaws.com/STACKOPSLOGO-ICON.png"></span></b></b></font></span></span></span></span></p>
</b></font></div><div><p><font color="#000000" size="1">******************** ADVERTENCIA LEGAL ******************** <br>Le informamos, como destinatario de este mensaje, que el correo electrónico y las comunicaciones por medio de Internet no permiten asegurar ni garantizar la confidencialidad de los mensajes transmitidos, así como tampoco su integridad o su correcta recepción, por lo que STACKOPS TECHNOLOGIES S.L. no asume responsabilidad alguna por tales circunstancias. Si no consintiese en la utilización del correo electrónico o de las comunicaciones vía Internet le rogamos nos lo comunique y ponga en nuestro conocimiento de manera inmediata. Este mensaje va dirigido, de manera exclusiva, a su destinatario y contiene información confidencial y sujeta al secreto profesional, cuya divulgación no está permitida por la ley. En caso de haber recibido este mensaje por error, le rogamos que, de forma inmediata, nos lo comunique mediante correo electrónico remitido a nuestra atención y proceda a su eliminación, así como a la de cualquier documento adjunto al mismo. Asimismo, le comunicamos que la distribución, copia o utilización de este mensaje, o de cualquier documento adjunto al mismo, cualquiera que fuera su finalidad, están prohibidas por la ley. <br>
<br>***************** PRIVILEGED AND CONFIDENTIAL **************** <br>We hereby inform you, as addressee of this message, that e-mail and Internet do not guarantee the confidentiality, nor the completeness or proper reception of the messages sent and, thus, STACKOPS TECHNOLOGIES S.L. does not assume any liability for those circumstances. Should you not agree to the use of e-mail or to communications via Internet, you are kindly requested to notify us immediately. This message is intended exclusively for the person to whom it is addressed and contains privileged and confidential information protected from disclosure by law. If you are not the addressee indicated in this message, you should immediately delete it and any attachments and notify the sender by reply e-mail. In such case, you are hereby notified that any dissemination, distribution, copying or use of this message or any attachments, for any purpose, is strictly prohibited by law.</font></p>
</div><br>
</div>