'Update the received metadata_dict with information from the parsed data_manager_config_filename.'

def generate_data_manager_metadata(self, repo_dir, data_manager_config_filename, metadata_dict, shed_config_dict=None):

    if (data_manager_config_filename is None):
        return metadata_dict
    repo_path = self.repository.repo_path(self.app)
    try:
        repo_files_directory = self.repository.repo_files_directory(self.app)
        repo_dir = repo_files_directory
    except AttributeError:
        repo_files_directory = repo_path
    relative_data_manager_dir = util.relpath(os.path.split(data_manager_config_filename)[0], repo_dir)
    rel_data_manager_config_filename = os.path.join(relative_data_manager_dir, os.path.split(data_manager_config_filename)[1])
    data_managers = {}
    invalid_data_managers = []
    data_manager_metadata = {'config_filename': rel_data_manager_config_filename, 'data_managers': data_managers, 'invalid_data_managers': invalid_data_managers, 'error_messages': []}
    metadata_dict['data_manager'] = data_manager_metadata
    (tree, error_message) = xml_util.parse_xml(data_manager_config_filename)
    if (tree is None):
        data_manager_metadata['error_messages'].append(error_message)
        return metadata_dict
    tool_path = None
    if shed_config_dict:
        tool_path = shed_config_dict.get('tool_path', None)
    tools = {}
    for tool in metadata_dict.get('tools', []):
        tool_conf_name = tool['tool_config']
        if tool_path:
            tool_conf_name = os.path.join(tool_path, tool_conf_name)
        tools[tool_conf_name] = tool
    root = tree.getroot()
    data_manager_tool_path = root.get('tool_path', None)
    if data_manager_tool_path:
        relative_data_manager_dir = os.path.join(relative_data_manager_dir, data_manager_tool_path)
    for (i, data_manager_elem) in enumerate(root.findall('data_manager')):
        tool_file = data_manager_elem.get('tool_file', None)
        data_manager_id = data_manager_elem.get('id', None)
        if (data_manager_id is None):
            log.error(('Data    Manager    entry    is    missing    id    attribute    in    "%s".' % data_manager_config_filename))
            invalid_data_managers.append({'index': i, 'error_message': 'Data    Manager    entry    is    missing    id    attribute'})
            continue
        data_manager_name = data_manager_elem.get('name', data_manager_id)
        version = data_manager_elem.get('version', DataManager.DEFAULT_VERSION)
        guid = self.generate_guid_for_object(DataManager.GUID_TYPE, data_manager_id, version)
        data_tables = []
        if (tool_file is None):
            log.error(('Data    Manager    entry    is    missing    tool_file    attribute    in    "%s".' % data_manager_config_filename))
            invalid_data_managers.append({'index': i, 'error_message': 'Data    Manager    entry    is    missing    tool_file    attribute'})
            continue
        else:
            bad_data_table = False
            for data_table_elem in data_manager_elem.findall('data_table'):
                data_table_name = data_table_elem.get('name', None)
                if (data_table_name is None):
                    log.error(('Data    Manager    data_table    entry    is    missing    name    attribute    in    "%s".' % data_manager_config_filename))
                    invalid_data_managers.append({'index': i, 'error_message': 'Data    Manager    entry    is    missing    name    attribute'})
                    bad_data_table = True
                    break
                else:
                    data_tables.append(data_table_name)
            if bad_data_table:
                continue
        data_manager_metadata_tool_file = os.path.normpath(os.path.join(relative_data_manager_dir, tool_file))
        tool_metadata_tool_file = os.path.join(repo_files_directory, data_manager_metadata_tool_file)
        tool = tools.get(tool_metadata_tool_file, None)
        if (tool is None):
            log.error(("Unable    to    determine    tools    metadata    for    '%s'." % data_manager_metadata_tool_file))
            invalid_data_managers.append({'index': i, 'error_message': 'Unable    to    determine    tools    metadata'})
            continue
        data_managers[data_manager_id] = {'id': data_manager_id, 'name': data_manager_name, 'guid': guid, 'version': version, 'tool_config_file': data_manager_metadata_tool_file, 'data_tables': data_tables, 'tool_guid': tool['guid']}
        log.debug(('Loaded    Data    Manager    tool_files:    %s' % tool_file))
    return metadata_dict
