コード例 #1
0
import sys
import types
import uuid

import eventlet
import greenlet
from oslo_config import cfg

from sm_api.openstack.common import excutils
from sm_api.openstack.common.gettextutils import _
from sm_api.openstack.common import importutils
from sm_api.openstack.common import jsonutils
from sm_api.openstack.common import processutils as utils
from sm_api.openstack.common.rpc import common as rpc_common

zmq = importutils.try_import('eventlet.green.zmq')

# for convenience, are not modified.
pformat = pprint.pformat
Timeout = eventlet.timeout.Timeout
LOG = rpc_common.LOG
RemoteError = rpc_common.RemoteError
RPCException = rpc_common.RPCException

zmq_opts = [
    cfg.StrOpt('rpc_zmq_bind_address',
               default='*',
               help='ZeroMQ bind address. Should be a wildcard (*), '
               'an ethernet interface, or IP. '
               'The "host" option should point or resolve to this '
               'address.'),
コード例 #2
0
ファイル: impl_qpid.py プロジェクト: MarioCarrilloA/stx-ha
import itertools
import time
import uuid

import eventlet
import greenlet
from oslo_config import cfg

from sm_api.openstack.common.gettextutils import _
from sm_api.openstack.common import importutils
from sm_api.openstack.common import jsonutils
from sm_api.openstack.common import log as logging
from sm_api.openstack.common.rpc import amqp as rpc_amqp
from sm_api.openstack.common.rpc import common as rpc_common

qpid_messaging = importutils.try_import("qpid.messaging")
qpid_exceptions = importutils.try_import("qpid.messaging.exceptions")

LOG = logging.getLogger(__name__)

qpid_opts = [
    cfg.StrOpt('qpid_hostname',
               default='localhost',
               help='Qpid broker hostname'),
    cfg.IntOpt('qpid_port', default=5672, help='Qpid broker port'),
    cfg.ListOpt('qpid_hosts',
                default=['$qpid_hostname:$qpid_port'],
                help='Qpid HA cluster host:port pairs'),
    cfg.StrOpt('qpid_username',
               default='',
               help='Username for qpid connection'),
コード例 #3
0
ファイル: service.py プロジェクト: starlingx/ha
import random
import signal
import sys
import time

import eventlet
from eventlet import event
from oslo_config import cfg

from sm_api.openstack.common import eventlet_backdoor
from sm_api.openstack.common.gettextutils import _  # noqa
from sm_api.openstack.common import importutils
from sm_api.openstack.common import log as logging
from sm_api.openstack.common import threadgroup

rpc = importutils.try_import('sm_api.openstack.common.rpc')
CONF = cfg.CONF
LOG = logging.getLogger(__name__)


def _sighup_supported():
    return hasattr(signal, 'SIGHUP')


def _is_sighup(signo):
    return _sighup_supported() and signo == signal.SIGHUP


def _signo_to_signame(signo):
    signals = {signal.SIGTERM: 'SIGTERM', signal.SIGINT: 'SIGINT'}
    if _sighup_supported():
コード例 #4
0
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#

"""
The MatchMaker classes should accept a Topic or Fanout exchange key and
return keys for direct exchanges, per (approximate) AMQP parlance.
"""

from oslo_config import cfg

from sm_api.openstack.common import importutils
from sm_api.openstack.common import log as logging
from sm_api.openstack.common.rpc import matchmaker as mm_common

redis = importutils.try_import('redis')


matchmaker_redis_opts = [
    cfg.StrOpt('host',
               default='127.0.0.1',
               help='Host to locate redis'),
    cfg.IntOpt('port',
               default=6379,
               help='Use this port to connect to redis host.'),
    cfg.StrOpt('password',
               default=None,
               help='Password for Redis server. (optional)'),
]

CONF = cfg.CONF