diff options
-rw-r--r-- | .zuul.yaml | 70 | ||||
-rw-r--r-- | Dockerfile | 26 | ||||
-rw-r--r-- | doc/source/conf.py | 20 | ||||
-rw-r--r-- | gear/__init__.py | 21 | ||||
-rw-r--r-- | gear/tests/test_functional.py | 4 |
5 files changed, 119 insertions, 22 deletions
@@ -1,4 +1,61 @@ +- secret: + name: gear-opendev-dockerhub + data: + username: opendevzuul + password: !encrypted/pkcs1-oaep + - bROAu0oGBv+2l67dlC94t+s33rmdogBhWzyk7d/Zj7bSHZtfap2f1u+0RWogAKwjRtxtR + C6mqoVjKdWd+qBcnek0U/6Czgnhp5og3d9rsN+3SeQ9aOTTjoYkiqsg+c7N0rMh1AGndG + Qn3LU8i0EDGfzn5C+1KTcRHJ5brSrZzB+GsiXZxm8eLlupuFCep/yrUcnsH6f73sKGHQI + C9OcENQCelPLEdEtLb1eyx0hL1+o1ar0FdRCDrvZwih1SE/UUa18Zi7QCMEmkwZ8fil7B + zVtcBSTxTqIY49bgjerUykq0YKH1gTZrVC+UPFPjPZfNS39fxgcdqUMgbUTuWCoIrI0Jh + 2pKg+KZ/3L8zqcmqOZFQOFvVi7zOtXdKZI3rmWRAzM/BgVXFeBsQZkGZ75TzE8Xm70uA4 + WYdIva8kjBLrTz1/uRijZqNSrwM2fGO3VI+1SXUQI6FWJfZ+uSWzCDk9JswLPFzoXa7+J + ASDaygdGvU6q+pkxOQ/v9lgTnwZCdEAoCRdSZBKz/y3OosKAYIRIismLRJ9Kfkqxl8IEi + /0U+rSsWpWb5jufUcwAmL2Rj6YVcgUl3qSq2TzP3R+DPPda6Et4NZQ3RLpWP8if4VuNq7 + gJ2yQTSLJLOG6nhDMRJoW3GLjUMWUw3sbvFE1VzcIggIs4mfxVp21Ps/6hRoAI= + +- job: + name: gear-build-opendev-image + parent: opendev-build-docker-image + description: Build OpenDev Docker images for gear + requires: + - python-base-container-image + - python-builder-container-image + provides: gear-container-image + vars: &gear_opendev_image_vars + zuul_work_dir: src/opendev.org/opendev/gear + docker_images: + - context: . + repository: opendevorg/geard + target: geard + +- job: + name: gear-upload-opendev-image + parent: opendev-upload-docker-image + description: Build OpenDev gear Docker images and upload to Docker Hub. + requires: + - python-base-container-image + - python-builder-container-image + provides: gear-container-image + vars: *gear_opendev_image_vars + secrets: + - name: docker_credentials + secret: gear-opendev-dockerhub + pass-to-parent: true + +- job: + name: gear-promote-opendev-image + parent: opendev-promote-docker-image + description: Promote previously uploaded gear Docker images. + vars: *gear_opendev_image_vars + secrets: + - name: docker_credentials + secret: gear-opendev-dockerhub + pass-to-parent: true + - project: + vars: + release_python: python3 templates: - publish-opendev-tox-docs check: @@ -8,6 +65,7 @@ - tox-py35: nodeset: ubuntu-xenial - build-python-release + - gear-build-opendev-image gate: jobs: - tox-pep8 @@ -15,9 +73,19 @@ - tox-py35: nodeset: ubuntu-xenial - build-python-release + - gear-upload-opendev-image promote: jobs: - opendev-promote-python + - gear-promote-opendev-image release: jobs: - - opendev-release-python
\ No newline at end of file + - opendev-release-python + - upload-docker-image: + secrets: + name: docker_credentials + secret: gear-opendev-dockerhub + pass-to-parent: true + vars: + <<: *gear_opendev_image_vars + upload_docker_image_promote: false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..13a86af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Copyright (c) 2019 VEXXHOST, Inc. +# +# 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 opendevorg/python-builder as builder + +COPY . /tmp/src +RUN assemble + +FROM opendevorg/python-base as geard + +COPY --from=builder /output/ /output +RUN /output/install-from-bindep + +CMD ["/usr/local/bin/geard"] diff --git a/doc/source/conf.py b/doc/source/conf.py index a0880b6..9f05b93 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -41,8 +41,8 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'Gear' -copyright = u'2013, OpenStack Foundation' +project = 'Gear' +copyright = '2013, OpenStack Foundation' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -184,8 +184,8 @@ latex_elements = { # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Gear.tex', u'Gear Documentation', - u'OpenStack Foundation', 'manual'), + ('index', 'Gear.tex', 'Gear Documentation', + 'OpenStack Foundation', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -214,10 +214,10 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'gear', u'Gear Full Documentation', - [u'OpenStack Foundation'], 1), - ('geard', 'geard', u'async pure python Gearman daemon', - [u'OpenStack Foundation'], 8), + ('index', 'gear', 'Gear Full Documentation', + ['OpenStack Foundation'], 1), + ('geard', 'geard', 'async pure python Gearman daemon', + ['OpenStack Foundation'], 8), ] # If true, show URL addresses after external links. @@ -230,8 +230,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Gear', u'Gear Documentation', - u'OpenStack Foundation', 'Gear', 'One line description of project.', + ('index', 'Gear', 'Gear Documentation', + 'OpenStack Foundation', 'Gear', 'One line description of project.', 'Miscellaneous'), ] diff --git a/gear/__init__.py b/gear/__init__.py index 891804b..6201ad6 100644 --- a/gear/__init__.py +++ b/gear/__init__.py @@ -1261,15 +1261,18 @@ class BaseClient(BaseClientServer): start_time = time.time() while self.running: self.connections_condition.acquire() - while self.running and not self.active_connections: - if timeout is not None: - self._checkTimeout(start_time, timeout) - self.log.debug("Waiting for at least one active connection") - self.connections_condition.wait(timeout=1) - if self.active_connections: - self.log.debug("Active connection found") - connected = True - self.connections_condition.release() + try: + while self.running and not self.active_connections: + if timeout is not None: + self._checkTimeout(start_time, timeout) + self.log.debug("Waiting for at least one active " + "connection") + self.connections_condition.wait(timeout=1) + if self.active_connections: + self.log.debug("Active connection found") + connected = True + finally: + self.connections_condition.release() if connected: return diff --git a/gear/tests/test_functional.py b/gear/tests/test_functional.py index 3bca907..ca9b8c1 100644 --- a/gear/tests/test_functional.py +++ b/gear/tests/test_functional.py @@ -78,7 +78,7 @@ class TestFunctional(tests.BaseTestCase): def create_cert(self, cn, issuer=None, signing_key=None): key = crypto.PKey() - key.generate_key(crypto.TYPE_RSA, 1024) + key.generate_key(crypto.TYPE_RSA, 2048) cert = crypto.X509() subject = cert.get_subject() @@ -97,7 +97,7 @@ class TestFunctional(tests.BaseTestCase): else: cert.set_issuer(subject) if signing_key: - cert.sign(signing_key, 'sha1') + cert.sign(signing_key, 'sha256') else: cert.sign(key, 'sha1') |