features/environment.py: Make "import consul" optional.
This commit is contained in:
parent
35e242c759
commit
14ceef1ab9
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -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
20
debian/patches/consul_import.patch
vendored
Normal 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()
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
|
@ -2,3 +2,4 @@ sphinx_no_mathjax.patch
|
|||
startup_scripts.patch
|
||||
coverage_binary.patch
|
||||
relax_requirements.patch
|
||||
consul_import.patch
|
||||
|
|
Loading…
Reference in a new issue