You don't want to interpolate name_or_ip, or 'e' here, use %s.