示例#1
0
    def __init__(self,
                 mount_type,
                 root_helper=None,
                 execute=None,
                 *args,
                 **kwargs):
        mount_type_to_option_prefix = {
            'cifs': 'smbfs',
            'smbfs': 'smbfs',
        }

        self._local_path_for_loopback = kwargs.get('local_path_for_loopback',
                                                   False)

        if mount_type not in mount_type_to_option_prefix:
            raise exception.ProtocolNotSupported(protocol=mount_type)

        self._mount_type = mount_type
        option_prefix = mount_type_to_option_prefix[mount_type]

        self._mount_base = kwargs.get(option_prefix + '_mount_point_base')
        self._mount_options = kwargs.get(option_prefix + '_mount_options')

        self._smbutils = utilsfactory.get_smbutils()
        self._pathutils = utilsfactory.get_pathutils()
示例#2
0
    def __init__(self, mount_type, root_helper, execute=None, *args, **kwargs):
        super(RemoteFsClient, self).__init__(root_helper,
                                             execute=execute,
                                             *args,
                                             **kwargs)  # type: ignore

        mount_type_to_option_prefix = {
            'nfs': 'nfs',
            'cifs': 'smbfs',
            'glusterfs': 'glusterfs',
            'vzstorage': 'vzstorage',
            'quobyte': 'quobyte',
            'scality': 'scality'
        }

        if mount_type not in mount_type_to_option_prefix:
            raise exception.ProtocolNotSupported(protocol=mount_type)

        self._mount_type = mount_type
        option_prefix = mount_type_to_option_prefix[mount_type]

        self._mount_base: str
        self._mount_base = kwargs.get(option_prefix +
                                      '_mount_point_base')  # type: ignore
        if not self._mount_base:
            raise exception.InvalidParameterValue(
                err=_('%s_mount_point_base required') % option_prefix)

        self._mount_options = kwargs.get(option_prefix + '_mount_options')

        if mount_type == "nfs":
            self._check_nfs_options()
示例#3
0
    def __init__(self,
                 mount_type,
                 root_helper,
                 execute=putils.execute,
                 *args,
                 **kwargs):

        mount_type_to_option_prefix = {
            'nfs': 'nfs',
            'cifs': 'smbfs',
            'glusterfs': 'glusterfs',
            'vzstorage': 'vzstorage',
            'scality': 'scality_sofs'
        }

        if mount_type not in mount_type_to_option_prefix:
            raise exception.ProtocolNotSupported(protocol=mount_type)

        self._mount_type = mount_type
        option_prefix = mount_type_to_option_prefix[mount_type]

        self._mount_base = kwargs.get(option_prefix + '_mount_point_base')
        if not self._mount_base:
            raise exception.InvalidParameterValue(
                err=_('%s_mount_point_base required') % option_prefix)

        self._mount_options = kwargs.get(option_prefix + '_mount_options')

        if mount_type == "nfs":
            self._check_nfs_options()

        self.root_helper = root_helper
        self.set_execute(execute)
    def verify(self, protocol):
        protocol = protocol.upper()

        # NOTE(e0ne): iSCSI drivers works without issues, RBD and NFS don't
        # work. Drivers with other protocols are not tested yet.
        if protocol not in VerifyProtocol.SUPPORTED_PROCOTOLS:
            raise exception.ProtocolNotSupported(protocol=protocol)
示例#5
0
    def __init__(self, mount_type, root_helper,
                 execute=None, *args, **kwargs):
        # For backwards compatibility, `putils.execute` is interpreted
        # as a sentinel to mean "I want the os-brick default" :-/
        # This can be burnt as soon as we update all the callsites (in
        # nova+cinder) to the new default - and then we shall never
        # speak of it again.
        # TODO(gus): RemoteFsClient should probably inherit from Executor
        if execute is None or execute == putils.execute:
            execute = priv_rootwrap.execute

        mount_type_to_option_prefix = {
            'nfs': 'nfs',
            'cifs': 'smbfs',
            'glusterfs': 'glusterfs',
            'vzstorage': 'vzstorage',
            'quobyte': 'quobyte'
        }

        if mount_type not in mount_type_to_option_prefix:
            raise exception.ProtocolNotSupported(protocol=mount_type)

        self._mount_type = mount_type
        option_prefix = mount_type_to_option_prefix[mount_type]

        self._mount_base = kwargs.get(option_prefix + '_mount_point_base')
        if not self._mount_base:
            raise exception.InvalidParameterValue(
                err=_('%s_mount_point_base required') % option_prefix)

        self._mount_options = kwargs.get(option_prefix + '_mount_options')

        if mount_type == "nfs":
            self._check_nfs_options()

        self.root_helper = root_helper
        self.set_execute(execute)