From 34dce0edb1eafd1bb81d80d6bbb97ae1fd13c30b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 27 Feb 2019 04:34:00 +0000 Subject: pyflakes: Remove assigned but unread variables Change-Id: Ie257ac051739ea6f846d1aac2c8f778638b5f8a6 --- src/osmo_gsm_tester/modem.py | 12 ++++++------ src/osmo_gsm_tester/osmo_nitb.py | 2 -- src/osmo_gsm_tester/template.py | 1 - src/osmo_gsm_tester/util.py | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py index f9b827a..95ebb6b 100644 --- a/src/osmo_gsm_tester/modem.py +++ b/src/osmo_gsm_tester/modem.py @@ -125,7 +125,7 @@ def dbus_async_call(instance, proxymethod, *proxymethod_args, user_data = (result_handler, error_handler, user_data) # See https://lazka.github.io/pgi-docs/Gio-2.0/classes/DBusProxy.html#Gio.DBusProxy.call - ret = instance._bus.con.call( + instance._bus.con.call( instance._bus_name, instance._path, proxymethod._iface_name, proxymethod.__name__, GLib.Variant(proxymethod._sinargs, proxymethod_args), @@ -596,14 +596,14 @@ class Modem(log.Origin): if self.is_attached(): self.detach() connmgr = self.dbus.interface(I_CONNMGR) - prop = connmgr.SetProperty('RoamingAllowed', Variant('b', allow_roaming)) - prop = connmgr.SetProperty('Powered', Variant('b', True)) + connmgr.SetProperty('RoamingAllowed', Variant('b', allow_roaming)) + connmgr.SetProperty('Powered', Variant('b', True)) def detach(self): self.dbg('detach') connmgr = self.dbus.interface(I_CONNMGR) - prop = connmgr.SetProperty('RoamingAllowed', Variant('b', False)) - prop = connmgr.SetProperty('Powered', Variant('b', False)) + connmgr.SetProperty('RoamingAllowed', Variant('b', False)) + connmgr.SetProperty('Powered', Variant('b', False)) connmgr.DeactivateAll() connmgr.ResetContexts() # Requires Powered=false @@ -734,7 +734,7 @@ class Modem(log.Origin): call_dbus_obj = systembus_get(call_id) props = call_dbus_obj.GetProperties() state = props.get('State') - except Exception as e: + except Exception: self.log('asking call state for non existent call') log.log_exn() state = 'disconnected' diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 66ab2a6..e161ccb 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -176,8 +176,6 @@ class OsmoNitbCtrl(log.Origin): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) def subscriber_add(self, imsi, msisdn, ki=None, algo=None): - created = False - if algo: value = '%s,%s,%s,%s' % (imsi,msisdn,algo,ki) else: diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index c890963..6ce7ebd 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -51,7 +51,6 @@ def render(name, values): template = _lookup.get_template(tmpl_name) _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 930c86a..e9a1f30 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -64,7 +64,7 @@ def ip_to_iface(ip): for line in proc.stdout.readlines(): if 'inet' in line and ' ' + ip + '/' in line: return line.split()[-1] - except Exception as e: + except Exception: pass return None @@ -79,7 +79,7 @@ def dst_ip_get_local_bind(ip): if words[i] == 'src': return words[i+1] i += 1 - except Exception as e: + except Exception: pass return None -- cgit v1.2.3