Example #1
0
from xml.sax import saxutils

from cinder.brick.initiator import connector
from cinder import exception
from cinder.openstack.common import importutils
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils
from cinder.openstack.common import timeutils

CONF = cfg.CONF
LOG = logging.getLogger(__name__)
ISO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
PERFECT_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"

synchronized = lockutils.synchronized_with_prefix('cinder-')


def find_config(config_path):
    """Find a configuration file using the given hint.

    :param config_path: Full or relative path to the config.
    :returns: Full path of the config, if it exists.
    :raises: `cinder.exception.ConfigNotFound`

    """
    possible_locations = [
        config_path,
        os.path.join(CONF.state_path, "etc", "cinder", config_path),
        os.path.join(CONF.state_path, "etc", config_path),
        os.path.join(CONF.state_path, config_path),
Example #2
0
from cinder.brick import exception
from cinder.brick import executor
from cinder.brick.initiator import host_driver
from cinder.brick.initiator import linuxfc
from cinder.brick.initiator import linuxscsi
from cinder.brick.remotefs import remotefs
from cinder.i18n import _
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder.openstack.common import processutils as putils

LOG = logging.getLogger(__name__)

synchronized = lockutils.synchronized_with_prefix('brick-')
DEVICE_SCAN_ATTEMPTS_DEFAULT = 3


def get_connector_properties(root_helper, my_ip):
    """Get the connection properties for all protocols."""

    iscsi = ISCSIConnector(root_helper=root_helper)
    fc = linuxfc.LinuxFibreChannel(root_helper=root_helper)

    props = {}
    props['ip'] = my_ip
    props['host'] = socket.gethostname()
    initiator = iscsi.get_initiator()
    if initiator:
        props['initiator'] = initiator
Example #3
0
import os
import socket
import time

from oslo.config import cfg

from cinder.brick import exceptions
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder.openstack.common import processutils as putils

LOG = logging.getLogger(__name__)
CONF = cfg.CONF
synchronized = lockutils.synchronized_with_prefix('brick-')


def get_connector_properties():
    """Get the connection properties for all protocols."""

    iscsi = ISCSIConnector()
    fc = linuxfc.LinuxFibreChannel()

    props = {}
    props['ip'] = CONF.my_ip
    props['host'] = socket.gethostname()
    initiator = iscsi.get_initiator()
    if initiator:
        props['initiator'] = initiator
    wwpns = fc.get_fc_wwpns()
Example #4
0
from cinder import exception
from cinder.openstack.common import excutils
from cinder.openstack.common import importutils
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils
from cinder.openstack.common import timeutils


CONF = cfg.CONF
LOG = logging.getLogger(__name__)
ISO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
PERFECT_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"

synchronized = lockutils.synchronized_with_prefix('cinder-')


def find_config(config_path):
    """Find a configuration file using the given hint.

    :param config_path: Full or relative path to the config.
    :returns: Full path of the config, if it exists.
    :raises: `cinder.exception.ConfigNotFound`

    """
    possible_locations = [
        config_path,
        os.path.join(CONF.state_path, "etc", "cinder", config_path),
        os.path.join(CONF.state_path, "etc", config_path),
        os.path.join(CONF.state_path, config_path),
Example #5
0
import cinder.openstack.common.log as logging
from cinder import exception
from cinder import volume as vol_api
from cinder.openstack.common import excutils
from cinder.openstack.common import lockutils

from paxes_cinder import _
from paxes_cinder.k2aclient.v1.k2uom import PhysicalFibreChannelAdapter
from paxes_cinder.volume import rpcapi_product as vol_rpcapi
from paxes_cinder.k2aclient import client
from paxes_cinder.db import api as paxes_db_api
from paxes_cinder.k2aclient.v1 import k2web
from paxes_cinder.k2aclient.v1.shell import K2Encoder

synchronized = lockutils.synchronized_with_prefix('scohack-')

LOG = logging.getLogger(__name__)


CONF = cfg.CONF
scohack_opts = [
    cfg.IntOpt('scohack_k2_timeout',
               default=60,
               help='K2 timeout for scohack.'),
    cfg.StrOpt('scohack_k2_excdir',
               default='/var/log/cinder/k2a-ffdc/scohack',
               help='Location of k2 ffdc files.')
]

CONF.register_opts(scohack_opts)