

def delete_dhcp_options(context, dhcp_options_id):
    if (not dhcp_options_id):
        raise exception.MissingParameter(_('DHCP options ID must be specified'))
    dhcp_options = ec2utils.get_db_item(context, dhcp_options_id)
    vpcs = db_api.get_items(context, 'vpc')
    for vpc in vpcs:
        if (dhcp_options['id'] == vpc.get('dhcp_options_id')):
            raise exception.DependencyViolation(obj1_id=dhcp_options['id'], obj2_id=vpc['id'])
    db_api.delete_item(context, dhcp_options['id'])
    return True

dataset/ETHPy150Open openstack/ec2-api/ec2api/api/dhcp_options.py delete_dhcp_options/original