def METHOD_NAME(rule_obj, products):
    yaml_file, yaml_contents = ssg.rule_yaml.get_yaml_contents(rule_obj)
    prodtype_section = ssg.rule_yaml.get_section_lines(yaml_file, yaml_contents, 'prodtype')
    if not prodtype_section:
        print("Cannot modify empty prodtype to replace products from %s" % yaml_file,
              file=sys.stderr)
        sys.exit(1)
    parsed_changes = []
    for product in products:
        parsed_product = product.split('~')
        if not len(parsed_product) == 2:
            print("Invalid product replacement description: %s" % product,
                  file=sys.stderr)
            sys.exit(1)
        change = {
            'match': ssg.rule_yaml.parse_prodtype(parsed_product[0]),
            'replacement': ssg.rule_yaml.parse_prodtype(parsed_product[1]),
        }
        parsed_changes.append(change)
    prodtype_contents = ssg.rule_yaml.parse_from_yaml(yaml_contents, prodtype_section)
    prodtype = prodtype_contents['prodtype']
    current_prodtypes = ssg.rule_yaml.parse_prodtype(prodtype)
    new_prodtypes = set(current_prodtypes)
    for change in parsed_changes:
        if change['match'].issubset(current_prodtypes):
            new_prodtypes.difference_update(change['match'])
            new_prodtypes.update(change['replacement'])
    new_prodtype_str = ','.join(sorted(new_prodtypes))
    print("Current prodtype: %s" % prodtype)
    print("New prodtype: %s" % new_prodtype_str)
    yaml_contents = ssg.rule_yaml.update_key_value(yaml_contents, 'prodtype',
                                                   prodtype, new_prodtype_str)
    ssg.utils.write_list_file(yaml_file, yaml_contents)