def generate_config(self):
        # use shell style globbing, to allow control of the order in
        # which config chunks are included in the final output.
        new_ssh_config = ''
        for conf_file in sorted(
                glob.glob('{}/[0-9]*'.format(self.configd_dir))):
            try:
                # TODO if the file does not end with a blank line,
                # insert one into the output
                new_ssh_config += file(conf_file, 'r').read()
            except IOError as exc:
                logger.error(
                    'IOError ({0}) while tring to read {1}: {2}'.format(
                        exc.errno, conf_file, exc.strerror))
                continue
            except Exception as exc:
                logger.error('Unexpected exception: {}'.format(exc))
                continue
            else:
                logger.debug('{} was included'.format(conf_file))

        with configLock:
            # update content and size
            self.ssh_config = new_ssh_config
            self.files['/config']['st_size'] = len(self.ssh_config)

            # update mtime and atime of '/config' and '/'
            now = time.time()
            for attr in ('st_mtime', 'st_atime'):
                self.files['/config'][attr] = now
                self.files['/'][attr] = now
Not part of the FUSE API, this combines files from
dataset/ETHPy150Open markhellewell/sshconfigfs/sshconfigfs.py/SSHConfigFS.generate_config