예제 #1
0
#    under the License.

import gc
import pprint
import sys
import traceback

import eventlet
import eventlet.backdoor
import greenlet

from openstack.common import cfg

eventlet_backdoor_opts = [
    cfg.IntOpt('backdoor_port',
               default=None,
               help='port for eventlet backdoor to listen')
]

CONF = cfg.CONF
CONF.register_opts(eventlet_backdoor_opts)


def _dont_use_this():
    print "Don't use this, just disconnect instead"


def _find_objects(t):
    return filter(lambda o: isinstance(o, t), gc.get_objects())

예제 #2
0
A remote procedure call (rpc) abstraction.

For some wrappers that add message versioning to rpc, see:
    rpc.dispatcher
    rpc.proxy
"""

from openstack.common import cfg
from openstack.common import importutils

rpc_opts = [
    cfg.StrOpt('rpc_backend',
               default='%s.impl_kombu' % __package__,
               help="The messaging module to use, defaults to kombu."),
    cfg.IntOpt('rpc_thread_pool_size',
               default=64,
               help='Size of RPC thread pool'),
    cfg.IntOpt('rpc_conn_pool_size',
               default=30,
               help='Size of RPC connection pool'),
    cfg.IntOpt('rpc_response_timeout',
               default=60,
               help='Seconds to wait for a response from call or multicall'),
    cfg.IntOpt('rpc_cast_timeout',
               default=30,
               help='Seconds to wait before a cast expires (TTL). '
               'Only supported by impl_zmq.'),
    cfg.ListOpt('allowed_rpc_exception_modules',
                default=[
                    'openstack.common.exception',
                    'nova.exception',
예제 #3
0
    from keystoneclient.openstack.common import cfg
    CONF = cfg.CONF

# alternative middleware configuration in the main application's
# configuration file e.g. in nova.conf
# [keystone_authtoken]
# auth_host = 127.0.0.1
# auth_port = 35357
# auth_protocol = http
# admin_tenant_name = admin
# admin_user = admin
# admin_password = badpassword
opts = [
    cfg.StrOpt('auth_admin_prefix', default=''),
    cfg.StrOpt('auth_host', default='127.0.0.1'),
    cfg.IntOpt('auth_port', default=35357),
    cfg.StrOpt('auth_protocol', default='https'),
    cfg.StrOpt('auth_uri', default=None),
    cfg.BoolOpt('delay_auth_decision', default=False),
    cfg.StrOpt('admin_token'),
    cfg.StrOpt('admin_user'),
    cfg.StrOpt('admin_password'),
    cfg.StrOpt('admin_tenant_name', default='admin'),
    cfg.StrOpt('certfile'),
    cfg.StrOpt('keyfile'),
    cfg.StrOpt('signing_dir'),
    cfg.ListOpt('memcache_servers'),
    cfg.IntOpt('token_cache_time', default=300),
]
CONF.register_opts(opts, group='keystone_authtoken')
예제 #4
0
               help='ZeroMQ bind address. Should be a wildcard (*), '
               'an ethernet interface, or IP. '
               'The "host" option should point or resolve to this '
               'address.'),

    # The module.Class to use for matchmaking.
    cfg.StrOpt(
        'rpc_zmq_matchmaker',
        default=('openstack.common.rpc.'
                 'matchmaker.MatchMakerLocalhost'),
        help='MatchMaker driver',
    ),

    # The following port is unassigned by IANA as of 2012-05-21
    cfg.IntOpt('rpc_zmq_port',
               default=9501,
               help='ZeroMQ receiver listening port'),
    cfg.IntOpt('rpc_zmq_contexts',
               default=1,
               help='Number of ZeroMQ contexts, defaults to 1'),
    cfg.IntOpt('rpc_zmq_topic_backlog',
               default=None,
               help='Maximum number of ingress messages to locally buffer '
               'per topic. Default is unlimited.'),
    cfg.StrOpt('rpc_zmq_ipc_dir',
               default='/var/run/openstack',
               help='Directory for holding IPC sockets'),
    cfg.StrOpt('rpc_zmq_host',
               default=socket.gethostname(),
               help='Name of this node. Must be a valid hostname, FQDN, or '
               'IP address. Must match "host" option, if running Nova.')
예제 #5
0
               help='ZeroMQ bind address. Should be a wildcard (*), '
               'an ethernet interface, or IP. '
               'The "host" option should point or resolve to this '
               'address.'),

    # The module.Class to use for matchmaking.
    cfg.StrOpt(
        'rpc_zmq_matchmaker',
        default=('openstack.common.rpc.'
                 'matchmaker.MatchMakerLocalhost'),
        help='MatchMaker driver',
    ),

    # The following port is unassigned by IANA as of 2012-05-21
    cfg.IntOpt('rpc_zmq_port',
               default=9501,
               help='ZeroMQ receiver listening port'),
    cfg.IntOpt('rpc_zmq_port_pub',
               default=9502,
               help='ZeroMQ fanout publisher port'),
    cfg.IntOpt('rpc_zmq_contexts',
               default=1,
               help='Number of ZeroMQ contexts, defaults to 1'),
    cfg.StrOpt('rpc_zmq_ipc_dir',
               default='/var/run/openstack',
               help='Directory for holding IPC sockets'),
    cfg.StrOpt('rpc_zmq_host',
               default=socket.gethostname(),
               help='Name of this node. Must be a valid hostname, FQDN, or '
               'IP address. Must match "host" option, if running Nova.')
]
예제 #6
0
               help='Qpid broker hostname'),
    cfg.StrOpt('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'),
    cfg.StrOpt('qpid_password',
               default='',
               help='Password for qpid connection'),
    cfg.StrOpt('qpid_sasl_mechanisms',
               default='',
               help='Space separated list of SASL mechanisms to use for auth'),
    cfg.IntOpt('qpid_heartbeat',
               default=60,
               help='Seconds between connection keepalive heartbeats'),
    cfg.StrOpt('qpid_protocol',
               default='tcp',
               help="Transport to use, either 'tcp' or 'ssl'"),
    cfg.BoolOpt('qpid_tcp_nodelay',
                default=True,
                help='Disable Nagle algorithm'),
]

cfg.CONF.register_opts(qpid_opts)


class ConsumerBase(object):
    """Consumer base class."""
    def __init__(self, session, callback, node_name, node_opts, link_name,
예제 #7
0
            help='SSL version to use (valid only if SSL enabled)'),
 cfg.StrOpt('kombu_ssl_keyfile',
            default='',
            help='SSL key file (valid only if SSL enabled)'),
 cfg.StrOpt('kombu_ssl_certfile',
            default='',
            help='SSL cert file (valid only if SSL enabled)'),
 cfg.StrOpt('kombu_ssl_ca_certs',
            default='',
            help=('SSL certification authority file '
                  '(valid only if SSL enabled)')),
 cfg.StrOpt('rabbit_host',
            default='localhost',
            help='The RabbitMQ broker address where a single node is used'),
 cfg.IntOpt('rabbit_port',
            default=5672,
            help='The RabbitMQ broker port where a single node is used'),
 cfg.ListOpt('rabbit_hosts',
             default=['$rabbit_host:$rabbit_port'],
             help='RabbitMQ HA cluster host:port pairs'),
 cfg.BoolOpt('rabbit_use_ssl',
             default=False,
             help='connect over SSL for RabbitMQ'),
 cfg.StrOpt('rabbit_userid', default='guest', help='the RabbitMQ userid'),
 cfg.StrOpt('rabbit_password',
            default='guest',
            help='the RabbitMQ password'),
 cfg.StrOpt('rabbit_virtual_host',
            default='/',
            help='the RabbitMQ virtual host'),
 cfg.IntOpt('rabbit_retry_interval',
예제 #8
0
            default='5672',
            help='Qpid broker port'),
 cfg.StrOpt('qpid_username',
            default='',
            help='Username for qpid connection'),
 cfg.StrOpt('qpid_password',
            default='',
            help='Password for qpid connection'),
 cfg.StrOpt('qpid_sasl_mechanisms',
            default='',
            help='Space separated list of SASL mechanisms to use for auth'),
 cfg.BoolOpt('qpid_reconnect',
             default=True,
             help='Automatically reconnect'),
 cfg.IntOpt('qpid_reconnect_timeout',
            default=0,
            help='Reconnection timeout in seconds'),
 cfg.IntOpt('qpid_reconnect_limit',
            default=0,
            help='Max reconnections before giving up'),
 cfg.IntOpt('qpid_reconnect_interval_min',
            default=0,
            help='Minimum seconds between reconnection attempts'),
 cfg.IntOpt('qpid_reconnect_interval_max',
            default=0,
            help='Maximum seconds between reconnection attempts'),
 cfg.IntOpt('qpid_reconnect_interval',
            default=0,
            help='Equivalent to setting max and min to the same value'),
 cfg.IntOpt('qpid_heartbeat',
            default=60,