<div dir="ltr">I thought we had code in other places that split out stderr and only logged it if there was an actual error but I cannot find the reference now. I think that matches the original proposal. Not sure I like idea #3.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 21, 2015 at 9:21 AM, Stanislaw Bogatkin <span dir="ltr"><<a href="mailto:sbogatkin@mirantis.com" target="_blank">sbogatkin@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I spoken with Sergii about this and prepared a patch for get rid of SecurityWarning [0] - it was easy. But we can't get rid from <span style="font-size:12.8px">InsecurePlatformWarning so easy way. I see next options:</span><div><span style="font-size:12.8px">1. Update python version as [1] said - should be hard task</span></div><div><span style="font-size:12.8px">2. Downgrade urllib version to one without such warning - is a bad idea, as for me</span></div><div><span style="font-size:12.8px">3. Rewrite code to use non-standard ssl python module (pyOpenSSL, for example) - may be a massive task</span></div><div><span style="font-size:12.8px">4. Use something like 2>/dev/null to don't show stderr when call the command - doesn't looks good, cause problem can be seen on other places (I saw similar problems with keystone provider, for example)</span></div><div><span style="font-size:12.8px">5. Rewrite code to split stderr/stdout, as Sergey proposed - is a most reasonable idea, as for me.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">[0] <a href="https://review.openstack.org/#/c/237379" target="_blank">https://review.openstack.org/#/c/237379</a></span></div><div><span style="font-size:12.8px">[1] <a href="https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning" target="_blank">https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning</a></span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Oct 21, 2015 at 10:02 AM, Sergey Vasilenko <span dir="ltr"><<a href="mailto:svasilenko@mirantis.com" target="_blank">svasilenko@mirantis.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi, guys!<div><br><div>Now I observe potential-dangerous situation in the providers of puppet-neutron module. I want share details, because not only puppet-neutron module may be broken by warnings from Openstack CLI utilities.</div><div><br></div><div><br> After updating urllib3 library on my lab, commands like 'neutron net list' began to throw warnings, like:<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"><font face="monospace, monospace" size="1">root@node-2:~# neutron net-list<br>/usr/lib/python2.7/dist-packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see <a href="https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning" target="_blank">https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning</a>.<br>  InsecurePlatformWarning<br>/usr/lib/python2.7/dist-packages/urllib3/connection.py:251: SecurityWarning: Certificate has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See <a href="https://github.com/shazow/urllib3/issues/497" target="_blank">https://github.com/shazow/urllib3/issues/497</a> for details.)<br>  SecurityWarning<br>+--------------------------------------+-----------+-------------------------------------------------------+<br>| id                                   | name      | subnets                                               |<br>+--------------------------------------+-----------+-------------------------------------------------------+<br>| 9e1c0866-51f0-4659-8d5c-1c5d0843dab4 | net04_ext | 29c952ec-2a13-46fc-a8a1-6e2468a92a95 <a href="http://172.18.171.0/24" target="_blank">172.18.171.0/24</a>  |<br>| d70b399b-668b-4861-b092-4876ec65df60 | net04     | b87fbfd1-0e52-4ab6-8987-286ef0912d1f <a href="http://192.168.111.0/24" target="_blank">192.168.111.0/24</a> |<br>+--------------------------------------+-----------+-------------------------------------------------------+</font> </blockquote><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"><font face="monospace, monospace" size="1">root@node-2:~#</font></blockquote></div><div><div><div><br></div><div>Such urllib3 based warnings is only particular case. Warnings may appear by another reason while call any Openstack utilities.</div><div dir="ltr"><br></div><div>Such warnings lead to broke work of puppet-neutron manifests:</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">2015-10-20 16:42:11 +0000 /Stage[main]/Main/Openstack::Network::Create_network[net04]/Neutron_network[net04] (info): Evaluated in 5.51 seconds<br>2015-10-20 16:42:11 +0000 Puppet (debug): Prefetching neutron resources for neutron_subnet<br>2015-10-20 16:42:11 +0000 Puppet (debug): Executing '/usr/bin/neutron subnet-list --format=csv --column=id --quote=none'<br>2015-10-20 16:42:13 +0000 Puppet (debug): Executing '/usr/bin/neutron subnet-show --format=shell InsecurePlatformWarning'<br>2015-10-20 16:42:16 +0000 Puppet::Type::Neutron_subnet::ProviderNeutron (notice): Unable to complete neutron request due to non-fatal error: "Execution of '/usr/bin/neutron subnet-show --format=shell InsecurePlatformWarning' returned 1: /usr/lib/python2.7/dist-packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see <a href="https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning" target="_blank">https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning</a>.  InsecurePlatformWarning<br>/usr/lib/python2.7/dist-packages/urllib3/connection.py:251: SecurityWarning: Certificate has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See <a href="https://github.com/shazow/urllib3/issues/497" target="_blank">https://github.com/shazow/urllib3/issues/497</a> for details.)<br>  SecurityWarningUnable to find subnet with name 'InsecurePlatformWarning'<br>". Retrying for 7 sec.  </blockquote><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"> ..... </blockquote><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">Unable to find subnet with name 'InsecurePlatformWarning'<br>". Retrying for 0 sec.<br>2015-10-20 16:42:25 +0000 Puppet (debug): Executing '/usr/bin/neutron subnet-show --format=shell <font color="#ff0000">InsecurePlatformWarning</font>'<br>2015-10-20 16:42:27 +0000 Puppet (err): Could not prefetch neutron_subnet provider 'neutron': Can't retrieve subnet-show because Neutron or Keystone API is not available.<br>/etc/puppet/modules/neutron/lib/puppet/provider/neutron.rb:153:in `get_neutron_resource_attrs'<br>/etc/puppet/modules/neutron/lib/puppet/provider/neutron_subnet/neutron.rb:24:in `block in instances'<br>/etc/puppet/modules/neutron/lib/puppet/provider/neutron_subnet/neutron.rb:23:in `collect'<br>/etc/puppet/modules/neutron/lib/puppet/provider/neutron_subnet/neutron.rb:23:in `instances'<br>/etc/puppet/modules/neutron/lib/puppet/provider/neutron_subnet/neutron.rb:43:in `prefetch'<br>/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:277:in `prefetch'<br>/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:167:in `prefetch_if_necessary'<br>/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:67:in `block in evaluate' </blockquote><div><br></div><div>This happens, because Puppet mixing stderr and stdout while execute shell commands, like </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"><font face="monospace, monospace"><span style="color:rgb(51,51,51);font-size:12px;line-height:16.8px;white-space:pre-wrap">commands </span><span style="color:rgb(0,134,179);font-size:12px;line-height:16.8px;white-space:pre-wrap">:neutron</span><span style="color:rgb(51,51,51);font-size:12px;line-height:16.8px;white-space:pre-wrap"> => </span><span style="color:rgb(24,54,145);font-size:12px;line-height:16.8px;white-space:pre-wrap"><span>'</span>neutron<span>'</span></span></font></blockquote><div>And code, like </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"><a href="https://github.com/openstack/puppet-neutron/blob/master/lib/puppet/provider/neutron.rb#L134-L146" target="_blank">https://github.com/openstack/puppet-neutron/blob/master/lib/puppet/provider/neutron.rb#L134-L146</a></blockquote><div>parses stderr output also. Part of warnings gets into incoming data.</div><div dir="ltr"><br></div><div>IMHO this situation is potential dangerous for all puppet-openstack modules..</div><span><font color="#888888"><div dir="ltr"><br><div>/sv</div><div><br></div></div></font></span></div>
</div></div></div></div>
<br></div></div>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>