コード例 #1
0
    def __init__(self, array_endpoint):
		# init logger
        global logger
        logger = get_stdout_logger()

        self.endpoint = array_endpoint

        my_path = os.path.abspath(os.path.dirname(__file__))
        path = os.path.join(my_path, "../../common/config.yaml")

        with open(path, 'r') as yamlfile:
            self.cfg = yaml.safe_load(yamlfile)  # TODO: add the following when possible : Loader=yaml.FullLoader)
コード例 #2
0
import controller.controller_server.config as config
import controller.controller_server.utils as utils
from controller.array_action import messages
from controller.array_action.storage_agent import get_agent, detect_array_type
from controller.common import settings
from controller.common.csi_logger import get_stdout_logger
from controller.common.node_info import NodeIdInfo
from controller.common.utils import set_current_thread_name
from controller.controller_server import messages as controller_messages
from controller.controller_server.errors import ObjectIdError, ValidationException
from controller.controller_server.exception_handler import handle_common_exceptions, handle_exception, \
    build_error_response
from controller.csi_general import csi_pb2
from controller.csi_general import csi_pb2_grpc

logger = get_stdout_logger()


class CSIControllerServicer(csi_pb2_grpc.ControllerServicer):
    """
    gRPC server for Digestor Service
    """
    def __init__(self):
        my_path = os.path.abspath(os.path.dirname(__file__))
        path = os.path.join(my_path, "../../common/config.yaml")

        with open(path, 'r') as yamlfile:
            self.cfg = yaml.safe_load(
                yamlfile
            )  # TODO: add the following when possible : Loader=yaml.FullLoader)