From c4bc9aed97c7434c8c114352a490c3e8c918d38d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 21 Dec 2010 20:56:13 -0500 Subject: [PATCH] use gethostbyname for determining PLC_API_IP argument like plc.d/postgresql --- aspects/ratelimitaspects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aspects/ratelimitaspects.py b/aspects/ratelimitaspects.py index 5aeaa86..836b2ba 100644 --- a/aspects/ratelimitaspects.py +++ b/aspects/ratelimitaspects.py @@ -18,6 +18,7 @@ import memcache import os import sys +import socket class BaseRateLimit(object): @@ -105,7 +106,7 @@ Subject: %(subject)s api_method_caller = "unknown" # excludes - if api_method_source == None or api_method_source[0] == self.config.PLC_API_IP or api_method_source[0] in self.whitelist: + if api_method_source == None or api_method_source[0] == socket.gethostbyname(self.config.PLC_API_HOST) or api_method_source[0] in self.whitelist: return # sanity check -- 2.43.0