def modify_fields_to_db(self, fields):
        result = super(AllowedAddressPair, self).modify_fields_to_db(fields)
        if 'ip_address' in result:
            result['ip_address'] = str(result['ip_address'])
        if 'mac_address' in result:
            result['mac_address'] = str(result['mac_address'])
        return result

    # TODO(mhickey): get rid of it once we switch the db model to using
    # custom types.
dataset/ETHPy150Open openstack/neutron/neutron/objects/port/extensions/allowedaddresspairs.py/AllowedAddressPair.modify_fields_to_db/original