Exemple #1
0
    def __call__(self, func):
        if self.logger is None:
            LOG = logging.getLogger(func.__module__)
            self.logger = LOG.exception

        def call(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                with excutils.save_and_reraise_exception():
                    self.logger(e)
        return call
Exemple #2
0
    def __call__(self, func):
        if self.logger is None:
            LOG = logging.getLogger(func.__module__)
            self.logger = LOG.exception

        def call(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                with excutils.save_and_reraise_exception():
                    self.logger(e)

        return call
Exemple #3
0
#    License for the specific language governing permissions and limitations
#    under the License.
"""
Routines for configuring Octavia
"""

from oslo.config import cfg
from oslo.db import options as db_options
from oslo import messaging
# from paste import deploy

from octavia.common import utils
from octavia.openstack.common import log as logging
from octavia import version

LOG = logging.getLogger(__name__)

core_opts = [
    cfg.StrOpt('bind_host',
               default='0.0.0.0',
               help=_("The host IP to bind to")),
    cfg.IntOpt('bind_port', default=9696, help=_("The port to bind to")),
    cfg.StrOpt('api_paste_config',
               default="api-paste.ini",
               help=_("The API paste config file to use")),
    cfg.StrOpt('api_extensions_path',
               default="",
               help=_("The path for API extensions")),
    cfg.StrOpt('auth_strategy',
               default='keystone',
               help=_("The type of authentication to use")),
Exemple #4
0
"""
Common classes for Barbican certificate handling
"""

from barbicanclient import client as barbican_client
from keystoneclient.auth.identity import v3 as keystone_client
from keystoneclient import session
from oslo.config import cfg
from oslo.utils import excutils

from octavia.certificates.common import cert
from octavia.i18n import _LE
from octavia.openstack.common import log as logging


LOG = logging.getLogger(__name__)

CONF = cfg.CONF
CONF.import_group('keystone_authtoken', 'octavia.common.config')


class BarbicanCert(cert.Cert):
    """Representation of a Cert based on the Barbican CertificateContainer."""
    def __init__(self, cert_container):
        if not isinstance(cert_container,
                          barbican_client.containers.CertificateContainer):
            raise TypeError(_LE(
                "Retrieved Barbican Container is not of the correct type "
                "(certificate)."))
        self._cert_container = cert_container