示例#1
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = log.getLogger("eventlet.wsgi.server")
     try:
         eventlet.wsgi.server(
             socket, application, custom_pool=self.pool, log=EventletFilteringLogger(logger), debug=False
         )
     except greenlet.GreenletExit:
         # Wait until all servers have completed running
         pass
     except Exception:
         LOG.exception(_("Server error"))
         raise
示例#2
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = log.getLogger('eventlet.wsgi.server')
     try:
         eventlet.wsgi.server(socket, application, custom_pool=self.pool,
                              log=EventletFilteringLogger(logger),
                              debug=False)
     except greenlet.GreenletExit:
         # Wait until all servers have completed running
         pass
     except Exception:
         LOG.exception(_('Server error'))
         raise
示例#3
0
#    License for the specific language governing permissions and limitations
#    under the License.
#

import unittest

from congress.openstack.common import log as logging
from congress.policy.builtin.congressbuiltin import _builtin_map
from congress.policy.builtin.congressbuiltin import CongressBuiltinCategoryMap
from congress.policy.builtin.congressbuiltin import CongressBuiltinPred

from congress.policy import compile
from congress.policy import runtime
from congress.tests import helper

LOG = logging.getLogger(__name__)

addmap = {
    'comparison': [
        {'func': 'f(x,y)', 'num_inputs': 2,
         'code': lambda x, y: x if x > y else y}],
    'newcategory': [
        {'func': 'g(x,y)', 'num_inputs': 2, 'code': lambda x, y: x + y}]}


append_builtin = {'arithmetic': [{'func': 'div(x,y)',
                                  'num_inputs': 2,
                                  'code': 'lambda x,y: x / y'}]}


class TestBuiltins(unittest.TestCase):
示例#4
0
    from plexxi.core.api.binding import VirtualMachine
    from plexxi.core.api.binding import VirtualSwitch
    from plexxi.core.api.binding import VmwareVirtualMachine
    from plexxi.core.api.session import CoreSession
except ImportError:
    pass

from oslo.config import cfg
import requests

from congress.datasources import constants
from congress.datasources import datasource_driver
from congress.managers.datasource import DataSourceManager
from congress.openstack.common import log as logging

LOG = logging.getLogger(__name__)


def d6service(name, keys, inbox, datapath, args):
    """This method is called by d6cage to create a dataservice instance."""

    return PlexxiDriver(name, keys, inbox, datapath, args)


class PlexxiDriver(datasource_driver.DataSourceDriver):
    HOSTS = "hosts"
    HOST_MACS = HOSTS + '.macs'
    HOST_GUESTS = HOSTS + '.guests'
    VMS = "vms"
    VM_MACS = VMS + '.macs'
    AFFINITIES = "affinities"