Returns true if the command passed is a fuse mountable application.

    CLI Example:

    .. code-block:: bash

        salt '*' mount.is_fuse_exec sshfs
484017
def is_fuse_exec(cmd):
    '''
    
    '''
    cmd_path = salt.utils.path.which(cmd)

    # No point in running ldd on a command that doesn't exist
    if not cmd_path:
        return False
    elif not salt.utils.path.which('ldd'):
        raise CommandNotFoundError('ldd')

    out = __salt__['cmd.run']('ldd {0}'.format(cmd_path), python_shell=False)
    return 'libfuse' in out
1108193
def salt_ssh():
    '''
    
    '''
    import salt.cli.ssh
    if '' in sys.path:
        sys.path.remove('')
    try:
        client = salt.cli.ssh.SaltSSH()
        _install_signal_handlers(client)
        client.run()
    except SaltClientError as err:
        trace = traceback.format_exc()
        try:
            hardcrash = client.options.hard_crash
        except (AttributeError, KeyError):
            hardcrash = False
        _handle_interrupt(
            SystemExit(err),
            err,
            hardcrash, trace=trace)
1165175
def _sysv_enabled(name, root):
    '''
    
    '''
    # Find exact match (disambiguate matches like "S01anacron" for cron)
    rc = _root('/etc/rc{}.d/S*{}'.format(_runlevel(), name), root)
    for match in glob.glob(rc):
        if re.match(r'S\d{,2}%s' % name, os.path.basename(match)):
            return True
    return False
61199
def is_installable_dir(path):
    # type: (str) -> bool
    
    if not os.path.isdir(path):
        return False
    setup_py = os.path.join(path, 'setup.py')
    if os.path.isfile(setup_py):
        return True
    pyproject_toml = os.path.join(path, 'pyproject.toml')
    if os.path.isfile(pyproject_toml):
        return True
    return False
373486
def fstab_mount(mountpoint):
    """"""
    cmd_args = ['mount', mountpoint]
    try:
        subprocess.check_output(cmd_args)
    except subprocess.CalledProcessError as e:
        log('Error unmounting {}\n{}'.format(mountpoint, e.output))
        return False
    return True
524801
def enable(iface):
    '''
    
    '''
    if is_enabled(iface):
        return True
    cmd = ['netsh', 'interface', 'set', 'interface',
           'name={0}'.format(iface),
           'admin=ENABLED']
    __salt__['cmd.run'](cmd, python_shell=False)
    return is_enabled(iface)
1259075
def is_executable_file(path):
    
    # follow symlinks,
    fpath = os.path.realpath(path)

    if not os.path.isfile(fpath):
        # non-files (directories, fifo, etc.)
        return False

    mode = os.stat(fpath).st_mode

    if (sys.platform.startswith('sunos')
            and os.getuid() == 0):
        # When root on Solaris, os.X_OK is True for *all* files, irregardless
        # of their executability -- instead, any permission bit of any user,
        # group, or other is fine enough.
        #
        # (This may be true for other "Unix98" OS's such as HP-UX and AIX)
        return bool(mode & (stat.S_IXUSR |
                            stat.S_IXGRP |
                            stat.S_IXOTH))

    return os.access(fpath, os.X_OK)
946094
def ssh_cmd(self, name, ssh_command):
        
        if not self.container_exists(name=name):
            exit("Unknown container {0}".format(name))

        if not self.container_running(name=name):
            exit("Container {0} is not running".format(name))

        ip = self.get_container_ip(name)
        if not ip:
            exit("Failed to get network address for "
                 "container {0}".format(name))
        if ssh_command:
            ssh.do_cmd('root', ip, 'password', " ".join(ssh_command))
        else:
            ssh.launch_shell('root', ip, 'password')
906661
def unmount(self):
        """"""
        if not self.mounted:
            return

        # Try to unmount properly.
        cmd = 'fusermount -u %s' % self.mount_point_local
        shell_exec(cmd)

        # The filesystem is probably still in use.
        # kill sshfs and re-run this same command (which will work then).
        if self.mounted:
            self._kill()
            shell_exec(cmd)

        self._mount_point_local_delete()
166520
def is_installable_dir(path):
    """"""
    if not os.path.isdir(path):
        return False
    setup_py = os.path.join(path, "setup.py")
    if os.path.isfile(setup_py):
        return True
    return False
1175193
def _active_mounts_freebsd(ret):
    '''
    
    '''
    for line in __salt__['cmd.run_stdout']('mount -p').split('\n'):
        comps = re.sub(r"\s+", " ", line).split()
        ret[comps[1]] = {'device': comps[0],
                         'fstype': comps[2],
                         'opts': _resolve_user_group_names(comps[3].split(','))}
    return ret
1166949
def _remote_chmod(self, paths, mode, sudoable=False):
        
        LOG.debug('_remote_chmod(%r, mode=%r, sudoable=%r)',
                  paths, mode, sudoable)
        return self.fake_shell(lambda: mitogen.select.Select.all(
            self._connection.get_chain().call_async(
                ansible_mitogen.target.set_file_mode, path, mode
            )
            for path in paths
        ))
979746
def has_shell_command(self, command):
        
        try:
            output = self.shell(['command', '-v',
                                 command]).decode('utf-8').strip()
            return command in output
        except AdbError:
            # If the command doesn't exist, then 'command -v' can return
            # an exit code > 1.
            return False
437376
def command_mount(self, system_id, *system_ids):
        
        system_ids = (system_id,) + system_ids
        has_failed = False
        for system_id in system_ids:
            try:
                system = SystemModel.create_by_id(system_id, self.environment)
                controller = SystemControllerModel(system, self.environment)
                controller.mount()
            except SftpConfigException as e:
                sys.stderr.write('Cannot mount %s: %s\n\n' % (system_id, str(e)))
                has_failed = True
            except SftpMountException as e:
                sys.stderr.write('Cannot mount %s!\n\n' % system_id)
                sys.stderr.write('Mount command: \n%s\n\n' % e.mount_cmd)
                sys.stderr.write('Command output: \n%s\n\n' % e.mount_cmd_output)
                has_failed = True
        if has_failed:
            sys.exit(1)
1294842
def isExe(self):
        
        if not self.isDll() and not self.isDriver() and ( consts.IMAGE_FILE_EXECUTABLE_IMAGE & self.ntHeaders.fileHeader.characteristics.value) == consts.IMAGE_FILE_EXECUTABLE_IMAGE:
            return True
        return False
1047245
def umount(mountpoint, persist=False):
    """"""
    cmd_args = ['umount', mountpoint]
    try:
        subprocess.check_output(cmd_args)
    except subprocess.CalledProcessError as e:
        log('Error unmounting {}\n{}'.format(mountpoint, e.output))
        return False

    if persist:
        return fstab_remove(mountpoint)
    return True
243414
def deploy_ext(self):
        '''
        
        '''
        if self.mods.get('file'):
            self.shell.send(
                self.mods['file'],
                os.path.join(self.thin_dir, 'salt-ext_mods.tgz'),
            )
        return True