Browse Source

Merge "Remove additional patching to use gitpython with eventlet"

changes/31/824431/1
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
80cf711107
  1. 1
      requirements.txt
  2. 2
      tripleo_common/tests/utils/test_config.py
  3. 2
      tripleo_common/utils/config.py
  4. 28
      tripleo_common/utils/safe_import.py

1
requirements.txt

@ -4,7 +4,6 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
GitPython>=1.0.1 # BSD License (3 clause)
eventlet!=0.20.1,>=0.20.0 # MIT
python-heatclient>=1.10.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0

2
tripleo_common/tests/utils/test_config.py

@ -12,6 +12,7 @@
import datetime
import fixtures
import git
import os
from unittest import mock
from unittest.mock import patch
@ -26,7 +27,6 @@ from tripleo_common import constants
from tripleo_common.tests import base
from tripleo_common.tests.fake_config import fakes
from tripleo_common.utils import config as ooo_config
from tripleo_common.utils.safe_import import git
RESOURCES_YAML_CONTENTS = """heat_template_version: 2016-04-08
resources:

2
tripleo_common/utils/config.py

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import git
import json
import logging
import os
@ -26,7 +27,6 @@ import jinja2
from tripleo_common import constants
from tripleo_common import inventory
from tripleo_common.utils.safe_import import git
LOG = logging.getLogger(__name__)

28
tripleo_common/utils/safe_import.py

@ -1,28 +0,0 @@
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from eventlet.green import subprocess
import eventlet.patcher as patcher
# Due to an eventlet issue subprocess is not being correctly patched
# on git.refs
patcher.inject('git.refs', None, ('subprocess', subprocess), )
# this has to be loaded after the inject.
import git # noqa: E402
Repo = git.Repo
Loading…
Cancel
Save