Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(114)  |  Call(88)  |  Derive(0)  |  Import(26)

src/s/a/sahara-2014.1/sahara/openstack/common/periodic_task.py   sahara(Download)
import six
 
from sahara.openstack.common.gettextutils import _, _LE, _LI
from sahara.openstack.common import log as logging
 
class InvalidPeriodicTaskArg(Exception):
    message = _("Unexpected argument for periodic task creation: %(arg)s.")
 
 
def periodic_task(*args, **kwargs):

src/s/a/sahara-HEAD/sahara/openstack/common/periodic_task.py   sahara(Download)
import six
 
from sahara.openstack.common.gettextutils import _, _LE, _LI
from sahara.openstack.common import log as logging
 
class InvalidPeriodicTaskArg(Exception):
    message = _("Unexpected argument for periodic task creation: %(arg)s.")
 
 
def periodic_task(*args, **kwargs):

src/s/a/sahara-2014.1/sahara/openstack/common/lockutils.py   sahara(Download)
 
from sahara.openstack.common import fileutils
from sahara.openstack.common.gettextutils import _  # noqa
from sahara.openstack.common import local
from sahara.openstack.common import log as logging
            self.lockfile.close()
        except IOError:
            LOG.exception(_("Could not release the acquired lock `%s`"),
                          self.fname)
 
 
    with sem:
        LOG.debug(_('Got semaphore "%(lock)s"'), {'lock': name})
 
        # NOTE(mikal): I know this looks odd
        try:
            if external and not CONF.disable_process_locking:
                LOG.debug(_('Attempting to grab file lock "%(lock)s"'),
                          {'lock': name})
 
                if not os.path.exists(local_lock_path):
                    fileutils.ensure_tree(local_lock_path)
                    LOG.info(_('Created lock path: %s'), local_lock_path)
 
                def add_prefix(name, prefix):

src/s/a/sahara-HEAD/sahara/openstack/common/lockutils.py   sahara(Download)
 
from sahara.openstack.common import fileutils
from sahara.openstack.common.gettextutils import _  # noqa
from sahara.openstack.common import local
from sahara.openstack.common import log as logging
            self.lockfile.close()
        except IOError:
            LOG.exception(_("Could not release the acquired lock `%s`"),
                          self.fname)
 
 
    with sem:
        LOG.debug(_('Got semaphore "%(lock)s"'), {'lock': name})
 
        # NOTE(mikal): I know this looks odd
        try:
            if external and not CONF.disable_process_locking:
                LOG.debug(_('Attempting to grab file lock "%(lock)s"'),
                          {'lock': name})
 
                if not os.path.exists(local_lock_path):
                    fileutils.ensure_tree(local_lock_path)
                    LOG.info(_('Created lock path: %s'), local_lock_path)
 
                def add_prefix(name, prefix):

src/s/a/sahara-2014.1/sahara/openstack/common/sslutils.py   sahara(Download)
from oslo.config import cfg
 
from sahara.openstack.common.gettextutils import _  # noqa
 
 
 
    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/s/a/sahara-2014.1/sahara/openstack/common/crypto/utils.py   sahara(Download)
from Crypto import Random
 
from sahara.openstack.common.gettextutils import _  # noqa
from sahara.openstack.common import importutils
 
 
class CryptoutilsException(Exception):
    """Generic Exception for Crypto utilities."""
 
    message = _("An unknown error occurred in crypto utils.")
    def __init__(self, requested, permitted):
        msg = _("Block size of %(given)d is too big, max = %(maximum)d")
        message = msg % {'given': requested, 'maximum': permitted}
        super(CryptoutilsException, self).__init__(message)
 
    def __init__(self, requested, permitted):
        msg = _("Length of %(given)d is too long, max = %(maximum)d")
        message = msg % {'given': requested, 'maximum': permitted}
        super(CryptoutilsException, self).__init__(message)
 

src/s/a/sahara-2014.1/sahara/openstack/common/db/sqlalchemy/utils.py   sahara(Download)
from sqlalchemy.types import NullType
 
from sahara.openstack.common.gettextutils import _
 
from sahara.openstack.common import log as logging
class InvalidSortKey(Exception):
    message = _("Sort key supplied was not valid.")
 
 
# copy from glance/db/sqlalchemy/api.py
        # TODO(justinsb): If this ever gives a false-positive, check
        # the actual primary key, rather than assuming its id
        LOG.warning(_('Id not in sort_keys; is sort_keys unique?'))
 
    assert(not (sort_dir and sort_dirs))
            }[current_sort_dir]
        except KeyError:
            raise ValueError(_("Unknown sort direction, "
                               "must be 'desc' or 'asc'"))
        try:
def _get_not_supported_column(col_name_col_instance, column_name):
    try:
        column = col_name_col_instance[column_name]
    except KeyError:
        msg = _("Please specify column %s in col_name_col_instance "

src/s/a/sahara-HEAD/sahara/openstack/common/db/sqlalchemy/utils.py   sahara(Download)
from sqlalchemy.types import NullType
 
from sahara.openstack.common.gettextutils import _
 
from sahara.openstack.common import log as logging
class InvalidSortKey(Exception):
    message = _("Sort key supplied was not valid.")
 
 
# copy from glance/db/sqlalchemy/api.py
        # TODO(justinsb): If this ever gives a false-positive, check
        # the actual primary key, rather than assuming its id
        LOG.warning(_('Id not in sort_keys; is sort_keys unique?'))
 
    assert(not (sort_dir and sort_dirs))
            }[current_sort_dir]
        except KeyError:
            raise ValueError(_("Unknown sort direction, "
                               "must be 'desc' or 'asc'"))
        try:
def _get_not_supported_column(col_name_col_instance, column_name):
    try:
        column = col_name_col_instance[column_name]
    except KeyError:
        msg = _("Please specify column %s in col_name_col_instance "

src/s/a/sahara-2014.1/sahara/openstack/common/processutils.py   sahara(Download)
import six
 
from sahara.openstack.common.gettextutils import _
from sahara.openstack.common import log as logging
 
 
        if description is None:
            description = _("Unexpected error while running command.")
        if exit_code is None:
            exit_code = '-'
        message = _('%(description)s\n'
 
    if kwargs:
        raise UnknownArgumentError(_('Got unknown keyword args '
                                     'to utils.execute: %r') % kwargs)
 
    if run_as_root and hasattr(os, 'geteuid') and os.geteuid() != 0:
        if not root_helper:
            raise NoRootWrapSpecified(
                message=_('Command requested root, but did not '

src/s/a/sahara-HEAD/sahara/openstack/common/processutils.py   sahara(Download)
import six
 
from sahara.openstack.common.gettextutils import _
from sahara.openstack.common import log as logging
 
 
        if description is None:
            description = _("Unexpected error while running command.")
        if exit_code is None:
            exit_code = '-'
        message = _('%(description)s\n'
 
    if kwargs:
        raise UnknownArgumentError(_('Got unknown keyword args '
                                     'to utils.execute: %r') % kwargs)
 
    if run_as_root and hasattr(os, 'geteuid') and os.geteuid() != 0:
        if not root_helper:
            raise NoRootWrapSpecified(
                message=_('Command requested root, but did not '

  1 | 2 | 3  Next