From ddeed8d916e230dd58db0fb164aa03e105b17c53 Mon Sep 17 00:00:00 2001 From: albailey Date: Thu, 18 Nov 2021 14:54:46 -0600 Subject: [PATCH] Fix tox certificate issues in python2 Python2 tox jobs may fail due to expired CA certificates. The workaround is to explicitly set an environment variable. This env variable is only passed to python2.7 targets. If a developer is not currently blocked by certificate failures then they do not need to set anything. Ex: CURL_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem The py files are only updated to trigger the appropriate zuul tox jobs. Story: 2008943 Task: 44007 Signed-off-by: albailey Change-Id: Iba6c251368e41cd6a34dd4be4138f5eb4ad3804c --- .../controllerconfig/controllerconfig/config_management.py | 2 +- controllerconfig/controllerconfig/tox.ini | 1 + sysinv/sysinv/sysinv/sysinv/__init__.py | 4 +--- sysinv/sysinv/sysinv/tox.ini | 2 ++ tsconfig/tsconfig/tox.ini | 2 ++ tsconfig/tsconfig/tsconfig/__init__.py | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/controllerconfig/controllerconfig/controllerconfig/config_management.py b/controllerconfig/controllerconfig/controllerconfig/config_management.py index da5d938c48..be9dd5c998 100644 --- a/controllerconfig/controllerconfig/controllerconfig/config_management.py +++ b/controllerconfig/controllerconfig/controllerconfig/config_management.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2017-2019 Wind River Systems, Inc. +Copyright (c) 2017-2021 Wind River Systems, Inc. SPDX-License-Identifier: Apache-2.0 diff --git a/controllerconfig/controllerconfig/tox.ini b/controllerconfig/controllerconfig/tox.ini index 6cdd7d1193..8f4c5d6913 100644 --- a/controllerconfig/controllerconfig/tox.ini +++ b/controllerconfig/controllerconfig/tox.ini @@ -31,6 +31,7 @@ commands = {posargs} [testenv:py27] basepython = python2.7 deps = {[testenv]deps} +passenv = CURL_CA_BUNDLE commands = {[testenv]commands} stestr run {posargs} diff --git a/sysinv/sysinv/sysinv/sysinv/__init__.py b/sysinv/sysinv/sysinv/sysinv/__init__.py index 56425d0fce..69222af04f 100644 --- a/sysinv/sysinv/sysinv/sysinv/__init__.py +++ b/sysinv/sysinv/sysinv/sysinv/__init__.py @@ -1,6 +1,4 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2013 Hewlett-Packard Development Company, L.P. +# Copyright 2013-2021 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/sysinv/sysinv/sysinv/tox.ini b/sysinv/sysinv/sysinv/tox.ini index 7995f1e4e4..2f7d97ea3e 100644 --- a/sysinv/sysinv/sysinv/tox.ini +++ b/sysinv/sysinv/sysinv/tox.ini @@ -104,6 +104,7 @@ commands = [testenv:py27] basepython = python2.7 +passenv = CURL_CA_BUNDLE commands = {[testenv]commands} stestr run {posargs} @@ -179,6 +180,7 @@ commands = [testenv:cover] basepython = python2.7 +passenv = CURL_CA_BUNDLE deps = {[testenv]deps} setenv = {[testenv]setenv} PYTHON=coverage run --parallel-mode diff --git a/tsconfig/tsconfig/tox.ini b/tsconfig/tsconfig/tox.ini index 90bd3146b5..8a009704d9 100644 --- a/tsconfig/tsconfig/tox.ini +++ b/tsconfig/tsconfig/tox.ini @@ -33,6 +33,7 @@ commands = [testenv:py27] basepython = python2.7 +passenv = CURL_CA_BUNDLE commands = {[testenv:stestr]commands} [testenv:py36] @@ -65,6 +66,7 @@ max-line-length = 120 [testenv:flake8] basepython = python2.7 +passenv = CURL_CA_BUNDLE usedevelop = False skip_install = True commands = diff --git a/tsconfig/tsconfig/tsconfig/__init__.py b/tsconfig/tsconfig/tsconfig/__init__.py index 0da84c8ca5..f29b552199 100644 --- a/tsconfig/tsconfig/tsconfig/__init__.py +++ b/tsconfig/tsconfig/tsconfig/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2014 Wind River Systems, Inc. +Copyright (c) 2014-2021 Wind River Systems, Inc. SPDX-License-Identifier: Apache-2.0