Do one query before the loop to get a hash of all viewable firewalls for the vm, instead of one query per firewall.