"remote_ip is not None and remote_pwd is not None" will be more rigorous.