From dc69a2e9518af73e98c5c680002f273ba1901b87 Mon Sep 17 00:00:00 2001 From: bashmak Date: Sat, 4 Mar 2017 17:09:29 +0300 Subject: [PATCH] =?UTF-8?q?FIXBUG:=20=D0=92=20=D0=BE=D0=B4=D0=BD=D0=BE?= =?UTF-8?q?=D0=BC=20=D0=BC=D0=B5=D1=81=D1=82=D0=B5=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BF=D1=83=D1=82=D0=B0=D0=BB=20=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BC=D0=B8=20=D0=B2=D1=85=D0=BE=D0=B4=D1=8F=D1=89=D1=83?= =?UTF-8?q?=D1=8E=20=D0=B8=20=D0=B8=D1=81=D1=85=D0=B4=D1=8F=D1=89=D1=83?= =?UTF-8?q?=D1=8E=20=D1=81=D0=BA=D0=BE=D1=80=D0=BE=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent/mod_mikrotik.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/agent/mod_mikrotik.py b/agent/mod_mikrotik.py index b194015..cce99eb 100644 --- a/agent/mod_mikrotik.py +++ b/agent/mod_mikrotik.py @@ -186,18 +186,18 @@ class TransmitterManager(BaseTransmitter): if text_append == 'M': res = text_speed_digit elif text_append == 'k': - res = text_speed_digit / 0x400 # 1024 + res = text_speed_digit / 1000 #elif text_append == 'G': # res = text_speed_digit * 0x400 else: - res = float(re.sub(r'[a-zA-Z]', '', text_speed)) / 0x100000 # (1024**2) + res = float(re.sub(r'[a-zA-Z]', '', text_speed)) / 1000**2 return res try: speeds = info['=max-limit'].split('/') t = TariffStruct( - speedIn=parse_speed(speeds[0]), - speedOut=parse_speed(speeds[1]) + speedIn=parse_speed(speeds[1]), + speedOut=parse_speed(speeds[0]) ) a = AbonStruct( uid=int(info['=name'][3:]), @@ -386,13 +386,10 @@ class MikrotikTransmitter(QueueManager, IpAddressListManager): QueueManager.add(self, user) return if queue.abon != user: - print('Is ip:', queue.abon.ip, user.ip) - print('Is tariff:', queue.abon.tariff, user.tariff) QueueManager.update(self, user) # приостановливаем обслуживание абонента def pause_user(self, user): - print('Pause') IpAddressListManager.disable(self, user) QueueManager.disable(self, user)