def create_xml_from_ini(self, ini_filepath, ini_content):
        """
        Creates group.xml file from INI file. All tags are replaced by function
        update_value_list. Function also checks whether check script fulfills
        all criteria

        @param {str} ini_filepath - real path of ini file
        @param {dict} ini_content - options and values from ini file:
            {option1: value, option2: value, ...}
        @throws {IOError}
        """
        self.select_rules.append(xml_tags.SELECT_TAG)
        update_fnc = {
            'config_file': self.fnc_config_file,
            'check_script': self.fnc_check_script,
            'check_description': self.fnc_check_description,
            'solution': self.fnc_solution_text,
            'content_title': self.update_text,
            'content_description': self.update_text,
        }
        ModuleHelper.check_required_fields(ini_filepath, ini_content)
        self.mh = ModuleHelper(os.path.dirname(ini_filepath))

        self.update_values_list(self.rule, "{rule_tag}",
                                ''.join(xml_tags.RULE_SECTION))
        value_tag, check_export_tag = self.add_value_tag()
        self.update_values_list(self.rule, "{check_export}",
                                ''.join(check_export_tag))
        self.update_values_list(self.rule, "{group_value}",
                                ''.join(value_tag))

        for k, function in iter(update_fnc.items()):
            try:
                function(ini_content, k)
            except IOError as e:
                err_msg = "Invalid value of the field '%s' in INI file" \
                          " '%s'\n'%s': %s\n" % (k, ini_filepath,
                                                 ini_content[k], e.strerror)
                raise IOError(err_msg)

        self.update_values_list(
            self.rule, '{group_title}',
            html_escape(ini_content['content_title'])
        )
        if 'mode' not in ini_content:
            self.fnc_update_mode('migrate, upgrade')
        else:
            self.fnc_update_mode(ini_content['mode'])
    def create_xml_from_ini(self, ini_filepath, ini_content):
        """
        Creates group.xml file from INI file. All tags are replaced by function
        update_value_list. Function also checks whether check script fulfills
        all criteria

        @param {str} ini_filepath - real path of ini file
        @param {dict} ini_content - options and values from ini file:
            {option1: value, option2: value, ...}
        @throws {IOError}
        """
        self.select_rules.append(xml_tags.SELECT_TAG)
        update_fnc = {
            'config_file': self.fnc_config_file,
            'check_script': self.fnc_check_script,
            'check_description': self.fnc_check_description,
            'solution': self.fnc_solution_text,
            'content_title': self.update_text,
            'content_description': self.update_text,
        }
        ModuleHelper.check_required_fields(ini_filepath, ini_content)
        self.mh = ModuleHelper(os.path.dirname(ini_filepath))

        self.update_values_list(self.rule, "{rule_tag}",
                                ''.join(xml_tags.RULE_SECTION))
        value_tag, check_export_tag = self.add_value_tag()
        self.update_values_list(self.rule, "{check_export}",
                                ''.join(check_export_tag))
        self.update_values_list(self.rule, "{group_value}", ''.join(value_tag))

        for k, function in iter(update_fnc.items()):
            try:
                function(ini_content, k)
            except IOError as e:
                err_msg = "Invalid value of the field '%s' in INI file" \
                          " '%s'\n'%s': %s\n" % (k, ini_filepath,
                                                 ini_content[k], e.strerror)
                raise IOError(err_msg)

        self.update_values_list(self.rule, '{group_title}',
                                html_escape(ini_content['content_title']))
        if 'mode' not in ini_content:
            self.fnc_update_mode('migrate, upgrade')
        else:
            self.fnc_update_mode(ini_content['mode'])