def get_central_api(): """ The rpc.get_client() which is called upon the API object initialization will cause a assertion error if the designate.rpc.TRANSPORT isn't setup by rpc.init() before. This fixes that by creating the rpcapi when demanded. """ global CENTRAL_API if not CENTRAL_API: CENTRAL_API = rpcapi.CentralAPI() return CENTRAL_API
def __init__(self, *args, **kwargs): # NOTE: Central api needs a transport if not it fails. This is # normally done by the service init method. rpc.init(cfg.CONF) central_api = central_rpcapi.CentralAPI() endpoint = backend.get_backend( cfg.CONF['service:agent'].backend_driver, central_service=central_api) kwargs['endpoints'] = [endpoint] super(Service, self).__init__(*args, **kwargs)
def __init__(self): super(PoolCommands, self).__init__() rpc.init(cfg.CONF) self.central_api = central_rpcapi.CentralAPI()
def __init__(self, *args, **kw): super(NotificationHandler, self).__init__(*args, **kw) self.central_api = central_rpcapi.CentralAPI()
from oslo_config import cfg from designate.central import rpcapi as central_rpcapi from designate.context import DesignateContext from designate.notification_handler.base import BaseAddressHandler from keystoneclient.auth.identity import generic from keystoneclient import session as keystone_session from keystoneclient.v3 import client as keystone_client from oslo_log import log as logging import pipes import requests import subprocess LOG = logging.getLogger(__name__) central_api = central_rpcapi.CentralAPI() class BaseAddressWMFHandler(BaseAddressHandler): proxy_endpoint = "" def _delete(self, extra, managed=True, resource_id=None, resource_type='instance', criterion={}): """ Handle a generic delete of a fixed ip within a domain :param criterion: Criterion to search and destroy records
def _startup(self): rpc.init(cfg.CONF) self.central_api = central_rpcapi.CentralAPI()
def __init__(self): super(AkamaiCommands, self).__init__() rpc.init(cfg.CONF) self.central_api = central_rpcapi.CentralAPI() self.context.all_tenants = True
def __init__(self, app, app_args): super(ImportTLDs, self).__init__(app, app_args) self.central_api = central_rpcapi.CentralAPI()