Beispiel #1
0
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
#
# Author: Kiall Mac Innes <*****@*****.**>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from moniker.openstack.common import cfg

cfg.CONF.register_group(
    cfg.OptGroup(name='service:agent',
                 title="Configuration for Agent Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt(
        'backend-driver', default='bind9', help='The backend driver to use'),
],
                       group='service:agent')
Beispiel #2
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=('moniker.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.')
Beispiel #3
0
import sqlalchemy
from sqlalchemy.exc import DisconnectionError, OperationalError
import sqlalchemy.orm
from sqlalchemy.pool import NullPool, StaticPool

from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging

LOG = logging.getLogger(__name__)

_MAKER = None
_ENGINE = None

sql_opts = [
    cfg.IntOpt('sql_connection_debug',
               default=0,
               help='Verbosity of SQL debugging information. 0=None,'
               ' 100=Everything'),
    cfg.BoolOpt('sql_connection_trace',
                default=False,
                help='Add python stack traces to SQL as comment strings'),
    cfg.BoolOpt('sqlite_synchronous',
                default=True,
                help='If passed, use synchronous mode for sqlite'),
    cfg.IntOpt('sql_idle_timeout',
               default=3600,
               help='timeout before idle sql connections are reaped'),
    cfg.IntOpt('sql_max_retries',
               default=10,
               help='maximum db connection retries during startup. '
               '(setting -1 implies an infinite retry count)'),
    cfg.IntOpt('sql_retry_interval',
#    under the License.

import gc
import pprint
import sys
import traceback

import eventlet
import eventlet.backdoor
import greenlet

from moniker.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())

Beispiel #5
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',
Beispiel #6
0
A remote procedure call (rpc) abstraction.

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

from moniker.openstack.common import cfg
from moniker.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=[
                    'moniker.openstack.common.exception',
                    'nova.exception',
Beispiel #7
0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import flask
from moniker.openstack.common import cfg
from moniker.openstack.common import jsonutils

cfg.CONF.register_opts([
    cfg.StrOpt('api_host', default='0.0.0.0', help='API Host'),
    cfg.IntOpt('api_port', default=9001, help='API Port Number'),
    cfg.StrOpt('api_paste_config',
               default='moniker-api-paste.ini',
               help='File name for the paste.deploy config for moniker-api'),
    cfg.StrOpt('auth_strategy',
               default='noauth',
               help='The strategy to use for auth. Supports noauth or '
               'keystone'),
])

# Allows us to serialize datetime's etc
flask.helpers.json = jsonutils
Beispiel #8
0
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.quota.base import Quota

LOG = logging.getLogger(__name__)

cfg.CONF.register_opts([
    cfg.IntOpt('quota-domains',
               default=10,
               help='Number of domains allowed '
               'per tenant'),
    cfg.StrOpt('quota-domain-records',
               default=500,
               help='Number of records '
               'allowed per domain'),
])


def get_quota():
    quota_driver = cfg.CONF['service:central'].quota_driver

    return Quota.get_plugin(quota_driver, invoke_on_load=True)
Beispiel #9
0
    'xn--gecrj9c', 'xn--h2brj9c', 'xn--hgbk6aj7f53bba', 'xn--hlcj6aya9esc7a',
    'xn--j6w193g', 'xn--jxalpdlp', 'xn--kgbechtv', 'xn--kprw13d',
    'xn--kpry57d', 'xn--lgbbat1ad8j', 'xn--mgb9awbf', 'xn--mgbaam7a8h',
    'xn--mgbayh7gpa', 'xn--mgbbh1a71e', 'xn--mgbc0a9azcg', 'xn--mgberp4a5d4ar',
    'xn--mgbx4cd0ab', 'xn--o3cw4h', 'xn--ogbpf8fl', 'xn--p1ai', 'xn--pgbs0dh',
    'xn--s9brj9c', 'xn--wgbh1c', 'xn--wgbl6a', 'xn--xkc2al3hye2a',
    'xn--xkc2dl3a5ee0h', 'xn--yfro4i67o', 'xn--ygbi2ammx', 'xn--zckzah', 'xxx',
    'ye', 'yt', 'za', 'zm', 'zw'
]

cfg.CONF.register_group(
    cfg.OptGroup(name='service:central',
                 title="Configuration for Central Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt(
        'backend-driver', default='fake', help='The backend driver to use'),
    cfg.StrOpt('storage-driver',
               default='sqlalchemy',
               help='The storage driver to use'),
    cfg.StrOpt(
        'quota-driver', default='storage', help='The quota driver to use'),
    cfg.ListOpt('enabled-notification-handlers',
                default=[],
                help='Enabled Notification Handlers'),
    cfg.ListOpt('domain-name-blacklist',
                default=[
                    '\\.arpa\\.$', '\\.novalocal\\.$', '\\.localhost\\.$',
                    '\\.localdomain\\.$', '\\.local\\.$'
                ],
Beispiel #10
0
from moniker.openstack.common import log as logging
from moniker import utils
from moniker.backend import base
from sqlalchemy.ext.sqlsoup import SqlSoup
from sqlalchemy.engine.url import _parse_rfc1738_args
from moniker.sqlalchemy.session import get_engine, SQLOPTS

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(cfg.OptGroup(
    name='backend:mysqlbind9', title="Configuration for BIND9+MySQL Backend"
))

cfg.CONF.register_opts([
    cfg.StrOpt('rndc-host', default='127.0.0.1', help='RNDC Host'),
    cfg.IntOpt('rndc-port', default=953, help='RNDC Port'),
    cfg.StrOpt('rndc-config-file',
               default=None, help='RNDC Config File'),
    cfg.StrOpt('rndc-key-file', default=None, help='RNDC Key File'),
    cfg.StrOpt('dns-server-type', default='master',
               help='slave or master DNS server?'),
    cfg.BoolOpt('write-database', default=True,
                help='Write to the DNS mysqlbind database?'),
    cfg.StrOpt('database-dns-table',
               default='dns_domains',
               help='DNS schema'),
], group='backend:mysqlbind9')

cfg.CONF.register_opts(SQLOPTS, group='backend:mysqlbind9')

Beispiel #11
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,
Beispiel #12
0
               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."""
Beispiel #13
0
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import flask
from moniker.openstack.common import cfg
from moniker.openstack.common import jsonutils as json

cfg.CONF.register_group(
    cfg.OptGroup(name='service:api', title="Configuration for API Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt('api_host', default='0.0.0.0', help='API Host'),
    cfg.IntOpt('api_port', default=9001, help='API Port Number'),
    cfg.StrOpt('api_paste_config',
               default='api-paste.ini',
               help='File name for the paste.deploy config for moniker-api'),
    cfg.StrOpt('auth_strategy',
               default='noauth',
               help='The strategy to use for auth. Supports noauth or '
               'keystone'),
],
                       group='service:api')

# Allows us to serialize datetime's etc
flask.helpers.json = json
Beispiel #14
0
from sqlalchemy import (Column, DateTime, String, Text, Integer, ForeignKey,
                        Enum)
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import relationship, backref, object_mapper
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.openstack.common import timeutils
from moniker import exceptions
from moniker.storage.impl_sqlalchemy.session import get_session
from moniker.storage.impl_sqlalchemy.types import UUID, Inet

LOG = logging.getLogger(__name__)

sql_opts = [cfg.IntOpt('mysql_engine', default='InnoDB', help='MySQL engine')]

cfg.CONF.register_opts(sql_opts)

RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'NS']


def table_args():
    engine_name = urlparse(cfg.CONF.database_connection).scheme
    if engine_name == 'mysql':
        return {'mysql_engine': cfg.CONF.mysql_engine}
    return None


class Base(object):
    __abstract__ = True