def generate_config(self):
        """Not part of the FUSE API, this combines files from
        configd_dir into a single config "file".

        It uses shell style "globbing" of files, whose names start
        with a number, to allow control of the order in which config
        chunks are included in the final combined output.

        e.g. the directory referenced by configd_dir might contain
        files named:

            01_start
            05_tunnels
            10_workhosts
            30_personalhosts

        The generated ssh config would thus contain the contents of
        these files, in the order in which they appear above.

        An underscore in the name is not necessary for the file to be
        included in final output, only that the name start with a
        number.

        """
        # 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 __HOLE__ 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
dataset/ETHPy150Open markhellewell/sshconfigfs/sshconfigfs.py/SSHConfigFS.generate_config