features/environment.py: Make "import consul" optional.

This commit is contained in:
Christoph Berg 2018-02-06 15:33:01 +01:00
parent 35e242c759
commit 14ceef1ab9
3 changed files with 22 additions and 0 deletions

1
debian/changelog vendored
View file

@ -3,6 +3,7 @@ patroni (1.4.2-2) UNRELEASED; urgency=medium
[ Christoph Berg ]
* debian/tests: Tidy /tmp/pgpass?.
* debian/tests: Use zookeeperd when etcd-server is not available.
* features/environment.py: Make "import consul" optional.
-- Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org> Sat, 03 Feb 2018 14:09:20 +0100

20
debian/patches/consul_import.patch vendored Normal file
View file

@ -0,0 +1,20 @@
Move consul import to ConsulController class
Facilitates building on stretch where this module is not available
--- a/features/environment.py
+++ b/features/environment.py
@@ -1,5 +1,4 @@
import abc
-import consul
import datetime
import etcd
import kazoo.client
@@ -361,6 +360,7 @@ class AbstractDcsController(AbstractCont
class ConsulController(AbstractDcsController):
def __init__(self, context):
+ import consul
super(ConsulController, self).__init__(context)
os.environ['PATRONI_CONSUL_HOST'] = 'localhost:8500'
self._client = consul.Consul()

View file

@ -2,3 +2,4 @@ sphinx_no_mathjax.patch
startup_scripts.patch
coverage_binary.patch
relax_requirements.patch
consul_import.patch