for l in listeners:
        for p in l.get('policies', []):
            if p not in policy_names:
                raise SaltInvocationError('Listener {0} on ELB {1} refers to '
                        'undefined policy {2}.'.format(l['elb_port'], name, p))