sfw: Ensure the urllib3 used by requests gets the warning suppressed
2.16.0 unvendored all of the dependencies, however in 2.16.1 access to
urllib3 through the requests.packages module namespace was restored for
compatibility reasons.
Thus, to work with old and new versions of the library, we can still
use the old method, except on 2.16.0. Whoever encounters that bug can
fix it.
The patch allows openbmc-sfw to run on Ubuntu Zesty systems.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/openbmc-sfw b/openbmc-sfw
index ec3be9f..67a8ec3 100755
--- a/openbmc-sfw
+++ b/openbmc-sfw
@@ -247,8 +247,8 @@
args = parser.parse_args()
if args.suppress_insecure_warnings:
- import urllib3
- urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+ from requests.packages.urllib3.exceptions import InsecureRequestWarning
+ requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
if 'func' in args:
args.func(args)