Esempio n. 1
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket,
                          application,
                          custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))
Esempio n. 2
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket,
                          application,
                          custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))
Esempio n. 3
0
def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority', CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger('designate.openstack.common.notification.%s' %
                               message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Esempio n. 4
0
def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger(
        'designate.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Esempio n. 5
0
# 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 pecan
import pecan.deploy
from oslo.config import cfg
from designate.openstack.common import log as logging

LOG = logging.getLogger(__name__)


def setup_app(pecan_config):
    config = dict(pecan_config)

    if cfg.CONF.debug:
        config['app']['debug'] = True

    pecan.configuration.set_config(config, overwrite=True)

    app = pecan.make_app(
        pecan_config.app.root,
        debug=getattr(pecan_config.app, 'debug', False),
        force_canonical=getattr(pecan_config.app, 'force_canonical', True),
    )
Esempio n. 6
0
# 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 designate import exceptions
from designate.openstack.common import log as logging
from designate.quota.base import Quota
from designate.storage import api as sapi

LOG = logging.getLogger(__name__)


class StorageQuota(Quota):
    __plugin_name__ = 'storage'

    def __init__(self, storage_api=None):
        super(StorageQuota, self).__init__()

        if storage_api is None:
            storage_api = sapi.StorageAPI()

        self.storage_api = storage_api

    def _get_quotas(self, context, tenant_id):
        quotas = self.storage_api.find_quotas(context, {
Esempio n. 7
0
# License for the specific language governing permissions and limitations
# under the License.
from dns import reversename
from oslo.config import cfg
from stevedore import driver

from designate import exceptions
from designate.openstack.common import log as logging


cfg.CONF.register_opts([
    cfg.StrOpt('network_api', default='neutron', help='Which API to use.')
])


LOG = logging.getLogger()


def get_api(api):
    mngr = driver.DriverManager('designate.network_api', api)
    return mngr.driver()


class BaseAPI(object):
    """
    Base API
    """
    def _endpoints(self, service_catalog=None, service_type=None,
                   endpoint_type='publicURL', config_section=None,
                   region=None):
        if service_catalog is not None: