From 2c536aaf53d00c9f880fb33ce9595f1a2cdb6995 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 18 2015 15:11:15 +0000 Subject: Disable the urllib3 warnings only if either of the _VERIFY settings are False --- diff --git a/mdapi-get_repo_md b/mdapi-get_repo_md index 130414c..dce9312 100644 --- a/mdapi-get_repo_md +++ b/mdapi-get_repo_md @@ -52,9 +52,6 @@ from sqlalchemy import text import mdapi.lib as mdapilib import mdapi.file_lock as file_lock -# Suppress urllib3's warning about insecure requests -requests.packages.urllib3.disable_warnings() - KOJI_REPO = 'https://kojipkgs.fedoraproject.org/repos/' PKGDB2_URL = 'https://admin.fedoraproject.org/pkgdb/' DL_SERVER = 'http://dl.fedoraproject.org' @@ -420,7 +417,6 @@ def process_repo(tupl): install_db(name, tempdb, destfile) - def main(): ''' Get the repo metadata. ''' parser = argparse.ArgumentParser(prog="get_repo_md") @@ -446,6 +442,10 @@ def main(): PKGDB2_VERIFY = CONFIG.get('PKGDB2_VERIFY', PKGDB2_VERIFY) DL_VERIFY = CONFIG.get('DL_VERIFY', DL_VERIFY) + if not DL_VERIFY or not PKGDB2_VERIFY: + # Suppress urllib3's warning about insecure requests + requests.packages.urllib3.disable_warnings() + repositories = [] # Get the koji repo repositories.append(