Пример #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))
Пример #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))
Пример #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(
        'billingstack.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Пример #4
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 billingstack import exceptions
from billingstack.openstack.common import log

import operator

LOG = log.getLogger(__name__)


class Criteria(object):
    """
    An object to hold Criteria
    """
    def __init__(self, field, op, value):
        self.field = field
        self.op = op
        self.value = value

    @classmethod
    def from_dict(cls, data):
        return cls(**data)
Пример #5
0
#
# 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.
#
# Copied: Moniker
from billingstack.openstack.common import log as logging
from billingstack.storage import base


LOG = logging.getLogger(__name__)


class StorageEngine(base.StorageEngine):
    __plugin_type__ = 'central'
    __plugin_ns__ = 'billingstack.central.storage'


class Connection(base.Connection):
    pass