From: Joseph Sutton Date: Tue, 23 May 2023 02:20:30 +0000 (+1200) Subject: tests/auth_log: Simplify isRemote() X-Git-Tag: talloc-2.4.1~573 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=715c45da6ecb7d770f9b29d1cd9dc47ef876cb06;p=thirdparty%2Fsamba.git tests/auth_log: Simplify isRemote() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/auth_log_base.py b/python/samba/tests/auth_log_base.py index 2f9b13e4f44..ebe9c3a124a 100644 --- a/python/samba/tests/auth_log_base.py +++ b/python/samba/tests/auth_log_base.py @@ -98,11 +98,13 @@ class AuthLogTestBase(samba.tests.TestCase): if self.remoteAddress is None: return True - remote = None - if message["type"] == "Authorization": - remote = message["Authorization"]["remoteAddress"] - elif message["type"] == "Authentication": - remote = message["Authentication"]["remoteAddress"] + supported_types = { + "Authentication", + "Authorization", + } + message_type = message["type"] + if message_type in supported_types: + remote = message[message_type]["remoteAddress"] else: return False