Comment 1 for bug 1828470

Revision history for this message
Daniel Badea (daniel.badea) wrote :

To confirm urllib3.disable_warnins is not called without relying on log messages:

python <<EOF
import requests.packages.urllib3
from cephclient.wrapper import CephWrapper
def override(calls=[], query=False,
             func=requests.packages.urllib3.disable_warnings):
    if query:
        return len(calls)
    return calls.append(func())
requests.packages.urllib3.disable_warnings=override
CephWrapper().osd_df()
assert(requests.packages.urllib3.disable_warnings(query=True) == 0)
EOF

should not print AssertionError.

(python mock is not available on controller; this snippet patches disable_warnings(), calls CephWrapper() where HTTPS certificate checks are disabled then asserts disable_warnings() was not called)