publisher: allow to not inherit from ConfigPublisherBase
Change-Id: I9bb2f392bcdd5d920a8f0db883766e5439d7de73
This commit is contained in:
parent
c721cffb01
commit
0fce8e48a3
|
@ -16,11 +16,16 @@
|
|||
|
||||
import abc
|
||||
|
||||
import funcsigs
|
||||
from oslo_log import log
|
||||
from oslo_utils import netutils
|
||||
import six
|
||||
from stevedore import driver
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
def get_publisher(conf, url, namespace):
|
||||
"""Get publisher driver and load it.
|
||||
|
||||
|
@ -29,9 +34,12 @@ def get_publisher(conf, url, namespace):
|
|||
"""
|
||||
parse_result = netutils.urlsplit(url)
|
||||
loaded_driver = driver.DriverManager(namespace, parse_result.scheme)
|
||||
if issubclass(loaded_driver.driver, ConfigPublisherBase):
|
||||
if len(funcsigs.signature(loaded_driver.driver).parameters) == 2:
|
||||
return loaded_driver.driver(conf, parse_result)
|
||||
else:
|
||||
# We keep it just the time to cleanup panko
|
||||
LOG.warning("%s publisher use the deprecated class signature",
|
||||
parse_result.scheme)
|
||||
return loaded_driver.driver(parse_result)
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ cachetools>=1.1.0 # MIT License
|
|||
cotyledon>=1.3.0 #Apache-2.0
|
||||
futures>=3.0;python_version=='2.7' or python_version=='2.6' # BSD
|
||||
futurist>=0.11.0 # Apache-2.0
|
||||
funcsigs
|
||||
debtcollector>=1.2.0 # Apache-2.0
|
||||
jsonpath-rw-ext>=0.1.9 # Apache-2.0
|
||||
lxml>=2.3 # BSD
|
||||
|
|
Loading…
Reference in New Issue