'Load artifacts from all sources.'

def _ReloadArtifacts(self):

    self._artifacts = {}
    files_to_load = set()
    for dir_path in self._sources.get('dirs', set()):
        try:
            for file_name in os.listdir(dir_path):
                if (file_name.endswith('.json') or (file_name.endswith('.yaml') and (not file_name.startswith('test')))):
                    files_to_load.add(os.path.join(dir_path, file_name))
        except (IOError, OSError):
            logging.warn('Artifact    directory    not    found:    %s', dir_path)
    files_to_load |= self._sources.get('files', set())
    logging.debug('Loading    artifacts    from:    %s', files_to_load)
    self._LoadArtifactsFromFiles(files_to_load)
    self.ReloadDatastoreArtifacts()
