Registers a path specification mount point.

    Args:
      mount_point (str): mount point identifier.
      path_spec (PathSpec): path specification of the mount point.

    Raises:
      KeyError: if the corresponding mount point is already set.
509145
def RegisterMountPoint(cls, mount_point, path_spec):
    
    if mount_point in cls._mount_points:
      raise KeyError('Mount point: {0:s} already set.'.format(mount_point))

    cls._mount_points[mount_point] = path_spec
12904
def mount(self, path, fs):
        # type: (Text, Union[FS, Text]) -> None
        
        if isinstance(fs, text_type):
            from .opener import open_fs

            fs = open_fs(fs)

        if not isinstance(fs, FS):
            raise TypeError("fs argument must be an FS object or a FS URL")

        if fs is self:
            raise ValueError("Unable to mount self")
        _path = forcedir(abspath(normpath(path)))

        for mount_path, _ in self.mounts:
            if _path.startswith(mount_path):
                raise MountError("mount point overlaps existing mount")

        self.mounts.append((_path, fs))
        self.default_fs.makedirs(_path, recreate=True)
104356
def ExtractCredentialsFromPathSpec(self, path_spec):
    
    credentials = manager.CredentialsManager.GetCredentials(path_spec)
    for identifier in credentials.CREDENTIALS:
      value = getattr(path_spec, identifier, None)
      if value is None:
        continue

      self.SetCredential(path_spec, identifier, value)
1167402
def mount_point(self):
        
        if self._mount_point is None:
            cmd_create = ["podman", "create", self.target_name, "some-cmd"]
            self._mounted_container_id = subprocess.check_output(cmd_create).decode().rstrip()
            cmd_mount = ["podman", "mount", self._mounted_container_id]
            self._mount_point = subprocess.check_output(cmd_mount).decode().rstrip()
        return self._mount_point
107823
def mount_point(self):
        
        if self._mount_point is None:
            self._mount_point = os.path.join(self.tmpdir, "checkout")
            os.makedirs(self._mount_point)
            self._checkout()
        return self._mount_point
932175
def set_setpoint(self, setpointvalue):
        
        _checkSetpointValue( setpointvalue, self.setpoint_max )
        self.write_register( 4097, setpointvalue, 1)
1285102
def validate(
            self,
            point: Tuple[float, float, float],
            point_num: int,
            pipette_mount) -> str:
        
        _, _, cz = self._driver_to_deck_coords(self._position())
        if self._current_mount != pipette_mount and cz < SAFE_HEIGHT:
            self.move_to_safe_height()

        self._current_mount = pipette_mount
        self._current_point = point_num

        _, _, cz = self._driver_to_deck_coords(self._position())
        if cz < SAFE_HEIGHT:
            self.move_to_safe_height()

        tx, ty, tz = self._deck_to_driver_coords(point)
        if not feature_flags.use_protocol_api_v2():
            self.hardware._driver.move({'X': tx, 'Y': ty})
            self.hardware._driver.move({self._current_mount: tz})
        else:
            pt = types.Point(x=tx, y=ty, z=tz)
            self.hardware.move_to(self._current_mount, pt)
        return 'moved to point {}'.format(point)
1230238
def is_reparse_point(path):
	
	res = api.GetFileAttributes(path)
	return (
		res != api.INVALID_FILE_ATTRIBUTES
		and bool(res & api.FILE_ATTRIBUTE_REPARSE_POINT)
	)
867752
def delete_mountpoints(self, paths=None, folder_ids=None):
        
        self.delete_folders(paths=paths, folder_ids=folder_ids, f_type='link')
1130275
def FileEntryExistsByPathSpec(self, path_spec):
    
    tsk_vs_part, _ = tsk_partition.GetTSKVsPartByPathSpec(
        self._tsk_volume, path_spec)

    # The virtual root file has not corresponding TSK volume system part object
    # but should have a location.
    if tsk_vs_part is None:
      location = getattr(path_spec, 'location', None)
      return location is not None and location == self.LOCATION_ROOT

    return True
710469
def FileEntryExistsByPathSpec(self, path_spec):
    
    # Opening a file by identifier is faster than opening a file by location.
    fsapfs_file_entry = None
    location = getattr(path_spec, 'location', None)
    identifier = getattr(path_spec, 'identifier', None)

    try:
      if identifier is not None:
        fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_identifier(
            identifier)
      elif location is not None:
        fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_path(location)

    except IOError as exception:
      raise errors.BackEndError(exception)

    return fsapfs_file_entry is not None
530793
def realpath(self, spec, key):
        

        if key not in spec:
            # do nothing for now
            return

        if not spec[key]:
            logger.warning(
                "cannot resolve realpath of '%s' as it is not defined", key)
            return

        check = realpath(join(spec.get(WORKING_DIR, ''), spec[key]))
        if check != spec[key]:
            spec[key] = check
            logger.warning(
                "realpath of '%s' resolved to '%s', spec is updated",
                key, check
            )
        return check
816143
def add_point(self, point):
        
        assert isinstance(point, GeoPoint), \
            'point should be GeoPoint instance'
        point_hash = self.get_point_hash(point)
        points = self.data.setdefault(point_hash, [])
        points.append(point)
1307806
def _verify(self, path_prefix=None):
        """"""
        for field, spec in self.doc_spec.iteritems():
            path = self._append_path(path_prefix, field)

            # Standard dict-based spec
            if isinstance(spec, dict):
                self._verify_field_spec(spec, path)
            else:
                raise SchemaFormatException("Invalid field definition for {}", path)
872187
def register_entrypoints(self):
        
        for spec in iter_entry_points(self.entry_point_group):
            format_properties = {"name": spec.name}
            try:
                format_properties.update(spec.load())
            except (DistributionNotFound, ImportError) as err:
                self.log.info(
                    "ipymd format {} could not be loaded: {}".format(
                        spec.name, err))
                continue

            self.register(**format_properties)

        return self
1318387
def link_mountpoint(self, repo):
        '''
        
        '''
        lcachelink = salt.utils.path.join(repo.linkdir, repo._mountpoint)
        lcachedest = salt.utils.path.join(repo.cachedir, repo.root()).rstrip(os.sep)
        wipe_linkdir = False
        create_link = False
        try:
            with repo.gen_lock(lock_type='mountpoint', timeout=10):
                walk_results = list(os.walk(repo.linkdir, followlinks=False))
                if walk_results != repo.linkdir_walk:
                    log.debug(
                        'Results of walking %s differ from expected results',
                        repo.linkdir
                    )
                    log.debug('Walk results: %s', walk_results)
                    log.debug('Expected results: %s', repo.linkdir_walk)
                    wipe_linkdir = True
                else:
                    if not all(not salt.utils.path.islink(x[0])
                               and os.path.isdir(x[0])
                               for x in walk_results[:-1]):
                        log.debug(
                            'Linkdir parents of %s are not all directories',
                            lcachelink
                        )
                        wipe_linkdir = True
                    elif not salt.utils.path.islink(lcachelink):
                        wipe_linkdir = True
                    else:
                        try:
                            ldest = salt.utils.path.readlink(lcachelink)
                        except Exception:
                            log.debug(
                                'Failed to read destination of %s', lcachelink
                            )
                            wipe_linkdir = True
                        else:
                            if ldest != lcachedest:
                                log.debug(
                                    'Destination of %s (%s) does not match '
                                    'the expected value (%s)',
                                    lcachelink, ldest, lcachedest
                                )
                                # Since we know that the parent dirs of the
                                # link are set up properly, all we need to do
                                # is remove the symlink and let it be created
                                # below.
                                try:
                                    if salt.utils.platform.is_windows() \
                                            and not ldest.startswith('\\\\') \
                                            and os.path.isdir(ldest):
                                        # On Windows, symlinks to directories
                                        # must be removed as if they were
                                        # themselves directories.
                                        shutil.rmtree(lcachelink)
                                    else:
                                        os.remove(lcachelink)
                                except Exception as exc:
                                    log.exception(
                                        'Failed to remove existing git_pillar '
                                        'mountpoint link %s: %s',
                                        lcachelink, exc.__str__()
                                    )
                                wipe_linkdir = False
                                create_link = True

                if wipe_linkdir:
                    # Wiping implies that we need to create the link
                    create_link = True
                    try:
                        shutil.rmtree(repo.linkdir)
                    except OSError:
                        pass
                    try:
                        ldirname = os.path.dirname(lcachelink)
                        os.makedirs(ldirname)
                        log.debug('Successfully made linkdir parent %s', ldirname)
                    except OSError as exc:
                        log.error(
                            'Failed to os.makedirs() linkdir parent %s: %s',
                            ldirname, exc.__str__()
                        )
                        return False

                if create_link:
                    try:
                        os.symlink(lcachedest, lcachelink)
                        log.debug(
                            'Successfully linked %s to cachedir %s',
                            lcachelink, lcachedest
                        )
                        return True
                    except OSError as exc:
                        log.error(
                            'Failed to create symlink to %s at path %s: %s',
                            lcachedest, lcachelink, exc.__str__()
                        )
                        return False
        except GitLockError:
            log.error(
                'Timed out setting mountpoint lock for %s remote \'%s\'. If '
                'this error persists, it may be because an earlier %s '
                'checkout was interrupted. The lock can be cleared by running '
                '\'salt-run cache.clear_git_lock %s type=mountpoint\', or by '
                'manually removing %s.',
                self.role, repo.id, self.role, self.role,
                repo._get_lock_file(lock_type='mountpoint')
            )
            return False
        return True
166054
def _restripe(mountpoint, direction, *devices, **kwargs):
    '''
    
    '''
    fs_log = []

    if salt.utils.fsutils._is_device(mountpoint):
        raise CommandExecutionError(
            "Mountpount expected, while device \"{0}\" specified".format(mountpoint))

    mounted = False
    for device, mntpoints in six.iteritems(salt.utils.fsutils._get_mounts("btrfs")):
        for mntdata in mntpoints:
            if mntdata['mount_point'] == mountpoint:
                mounted = True
                break

    if not mounted:
        raise CommandExecutionError(
            "No BTRFS device mounted on \"{0}\" mountpoint".format(mountpoint))

    if not devices:
        raise CommandExecutionError("No devices specified.")

    available_devices = __salt__['btrfs.devices']()
    for device in devices:
        if device not in six.iterkeys(available_devices):
            raise CommandExecutionError("Device \"{0}\" is not recognized".format(device))

    cmd = ['btrfs device {0}'.format(direction)]
    for device in devices:
        cmd.append(device)

    if direction == 'add':
        if kwargs.get("nodiscard"):
            cmd.append("-K")
        if kwargs.get("force"):
            cmd.append("-f")

    cmd.append(mountpoint)

    out = __salt__['cmd.run_all'](' '.join(cmd))
    salt.utils.fsutils._verify_run(out)
    if out['stdout']:
        fs_log.append(out['stdout'])

    if direction == 'add':
        out = None
        data_conversion = kwargs.get("dc")
        meta_conversion = kwargs.get("mc")
        if data_conversion and meta_conversion:
            out = __salt__['cmd.run_all'](
                "btrfs balance start -dconvert={0} -mconvert={1} {2}".format(
                    data_conversion, meta_conversion, mountpoint))
        else:
            out = __salt__['cmd.run_all']("btrfs filesystem balance {0}".format(mountpoint))
        salt.utils.fsutils._verify_run(out)
        if out['stdout']:
            fs_log.append(out['stdout'])

    # Summarize the result
    ret = {}
    if fs_log:
        ret.update({'log': '\n'.join(fs_log)})
    ret.update(__salt__['btrfs.info'](mountpoint))

    return ret