def METHOD_NAME(conf, args, op_type):
    """Get the existing attribute from the server and return them in a dict
    so we can add them back after the operation is done.
    For op_type == OpType.delete, we delete them from the server so we can add
    back only those that are not specified in the command line.
    (i.e delete nsslapd-haproxy-trusted-ip="192.168.0.1", but
    nsslapd-haproxy-trusted-ip has 192.168.0.1 and 192.168.0.2 values.
    So we want only 192.168.0.1 to be deleted in the end)
    """
    existing_attrs = {}
    if args and args.attr:
        for attr in args.attr:
            if "=" in attr:
                [attr_name, val] = attr.split("=", 1)
                # We should process only multi-valued attributes this way
                if attr_name.lower() == "nsslapd-haproxy-trusted-ip" or \
                   attr_name.lower() == "nsslapd-referral":
                    if attr_name not in existing_attrs.keys():
                        existing_attrs[attr_name] = conf.get_attr_vals_utf8(attr_name)
                    existing_attrs[attr_name] = [x for x in existing_attrs[attr_name] if x != val]
                    if op_type == OpType.add:
                        if existing_attrs[attr_name] == []:
                            del existing_attrs[attr_name]
                    if op_type == OpType.delete:
                        conf.remove_all(attr_name)
            else:
                if op_type == OpType.delete:
                    conf.remove_all(attr)
                else:
                    raise ValueError(f"You must specify a value to add for the attribute ({attr_name})")
        return existing_attrs
    else:
        # Missing value
        raise ValueError(f"Missing attribute to {op_type.name}")