Did I find the right examples for you? yes no

All Samples(154)  |  Call(136)  |  Derive(0)  |  Import(18)

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/impl_zmq.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import excutils
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import importutils
from cloudbaseinit.openstack.common import jsonutils
    except TypeError:
        with excutils.save_and_reraise_exception():
            LOG.error(_("JSON serialization failed."))
 
 
def _deserialize(data):
    """Deserialization wrapper."""
    LOG.debug(_("Deserializing: %s"), data)
                    'subscribe': subscribe, 'bind': bind}
 
        LOG.debug(_("Connecting to %(addr)s with %(type)s"), str_data)
        LOG.debug(_("-> Subscribed to %(subscribe)s"), str_data)
        LOG.debug(_("-> bind: %(bind)s"), str_data)

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/common.py   cloudbase-init(Download)
import six
 
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import importutils
from cloudbaseinit.openstack.common import jsonutils
class RPCException(Exception):
    msg_fmt = _("An unknown RPC related exception occurred.")
 
    def __init__(self, message=None, **kwargs):
        self.kwargs = kwargs
                # kwargs doesn't match a variable in the message
                # log the issue and the kwargs
                LOG.exception(_('Exception in string format operation'))
                for name, value in six.iteritems(kwargs):
                    LOG.error("%s: %s" % (name, value))
 
    """
    msg_fmt = _("Remote error: %(exc_type)s %(value)s\n%(traceback)s.")
 
    def __init__(self, exc_type=None, value=None, traceback=None):
    waiting for a response from the remote side.
    """
    msg_fmt = _('Timeout while waiting on RPC response - '
                'topic: "%(topic)s", RPC method: "%(method)s" '
                'info: "%(info)s"')

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/service.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import eventlet_backdoor
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import importutils
from cloudbaseinit.openstack.common import log as logging
    def _wait_for_exit_or_signal(self, ready_callback=None):
        status = None
        signo = 0
 
        LOG.debug(_('Full set of CONF:'))
        except SignalExit as exc:
            signame = _signo_to_signame(exc.signo)
            LOG.info(_('Caught %s, exiting'), signame)
            status = exc.code
            signo = exc.signo
                except Exception:
                    # We're shutting down, so it doesn't matter at this point.
                    LOG.exception(_('Exception during rpc cleanup.'))
 
        return status, signo
        self.readpipe.read()
 
        LOG.info(_('Parent process has died unexpectedly, exiting'))
 
        sys.exit(1)

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/impl_qpid.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import excutils
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import importutils
from cloudbaseinit.openstack.common import jsonutils
def raise_invalid_topology_version(conf):
    msg = (_("Invalid value for qpid_topology_version: %d") %
           conf.qpid_topology_version)
    LOG.error(msg)
    raise Exception(msg)
            self.callback(msg)
        except Exception:
            LOG.exception(_("Failed to process message... skipping it."))
        finally:
            # TODO(sandy): Need support for optional ack_on_error.
            except qpid_exceptions.ConnectionError as e:
                msg_dict = dict(e=e, delay=delay)
                msg = _("Unable to connect to AMQP server: %(e)s. "
                        "Sleeping %(delay)s seconds") % msg_dict
                LOG.error(msg)
                time.sleep(delay)
                delay = min(2 * delay, 60)
            else:
                LOG.info(_('Connected to AMQP server on %s'), broker)

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/amqp.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import excutils
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import local
from cloudbaseinit.openstack.common import log as logging
    def create(self):
        LOG.debug(_('Pool creating new connection'))
        return self.connection_cls(self.conf)
 
    def empty(self):
    def _process_data(self, message_data):
        msg_id = message_data.pop('_msg_id', None)
        waiter = self._call_waiters.get(msg_id)
        if not waiter:
            LOG.warn(_('No calling threads waiting for msg_id : %(msg_id)s'
                       ', message : %(data)s'), {'msg_id': msg_id,
                                                 'data': message_data})
            LOG.warn(_('_call_waiters: %s') % str(self._call_waiters))
    def add_call_waiter(self, waiter, msg_id):
        self._num_call_waiters += 1
        if self._num_call_waiters > self._num_call_waiters_wrn_threshold:
            LOG.warn(_('Number of call waiters is greater than warning '
                       'threshold: %d. There could be a MulticallProxyWaiter '

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/impl_kombu.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import excutils
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import network_utils
from cloudbaseinit.openstack.common.rpc import amqp as rpc_amqp
        except Exception:
            if self.ack_on_error:
                LOG.exception(_("Failed to process message"
                                " ... skipping it."))
                message.ack()
            else:
                LOG.exception(_("Failed to process message"
        """
        if self.connection:
            LOG.info(_("Reconnecting to AMQP server on "
                     "%(hostname)s:%(port)d") % params)
            try:
        for consumer in self.consumers:
            consumer.reconnect(self.channel)
        LOG.info(_('Connected to AMQP server on %(hostname)s:%(port)d') %
                 params)
 

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/sslutils.py   cloudbase-init(Download)
from oslo.config import cfg
 
from cloudbaseinit.openstack.common.gettextutils import _
 
 
 
    if cert_file and not os.path.exists(cert_file):
        raise RuntimeError(_("Unable to find cert_file : %s") % cert_file)
 
    if ca_file and not os.path.exists(ca_file):
        raise RuntimeError(_("Unable to find ca_file : %s") % ca_file)
 
    if key_file and not os.path.exists(key_file):
        raise RuntimeError(_("Unable to find key_file : %s") % key_file)
 
    if use_ssl and (not cert_file or not key_file):
        raise RuntimeError(_("When running server in SSL mode, you must "
                             "specify both a cert_file and key_file "
                             "option value in your configuration file"))

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/notifier/api.py   cloudbase-init(Download)
 
from cloudbaseinit.openstack.common import context
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import importutils
from cloudbaseinit.openstack.common import jsonutils
    if priority not in log_levels:
        raise BadPriorityException(
            _('%s not in valid priorities') % priority)
 
    # Ensure everything is JSON serializable.
            driver.notify(context, msg)
        except Exception as e:
            LOG.exception(_("Problem '%(e)s' attempting to "
                            "send to notification system. "
                            "Payload=%(payload)s")
                _drivers[notification_driver] = driver
            except ImportError:
                LOG.exception(_("Failed to load notifier %s. "
                                "These notifications will not be sent.") %
                              notification_driver)

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/rpc/matchmaker.py   cloudbase-init(Download)
from oslo.config import cfg
 
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import log as logging
 
class MatchMakerException(Exception):
    """Signified a match could not be found."""
    message = _("Match not found by MatchMaker.")
 
 
    def __init__(self):
        # Array of tuples. Index [2] toggles negation, [3] is last-if-true
        self.bindings = []
 
        self.no_heartbeat_msg = _('Matchmaker does not implement '
        self.backend_unregister(key, '.'.join((key, host)))
 
        LOG.info(_("Matchmaker unregistered: %(key)s, %(host)s"),
                 {'key': key, 'host': host})
 
        if not self.hosts:
            raise MatchMakerException(
                _("Register before starting heartbeat."))
 
        def do_heartbeat():

src/c/l/cloudbase-init-HEAD/cloudbaseinit/openstack/common/loopingcall.py   cloudbase-init(Download)
from eventlet import greenthread
 
from cloudbaseinit.openstack.common.gettextutils import _
from cloudbaseinit.openstack.common import log as logging
from cloudbaseinit.openstack.common import timeutils
                    delay = interval - timeutils.delta_seconds(start, end)
                    if delay <= 0:
                        LOG.warn(_('task run outlasted interval by %s sec') %
                                 -delay)
                    greenthread.sleep(delay if delay > 0 else 0)
            except LoopingCallDone as e:
                self.stop()
                done.send(e.retvalue)
            except Exception:
                LOG.exception(_('in fixed duration looping call'))
                    if periodic_interval_max is not None:
                        idle = min(idle, periodic_interval_max)
                    LOG.debug(_('Dynamic looping call sleeping for %.02f '
                                'seconds'), idle)
                    greenthread.sleep(idle)
            except LoopingCallDone as e:
                self.stop()
                done.send(e.retvalue)
            except Exception:
                LOG.exception(_('in dynamic looping call'))

  1 | 2  Next