summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2019-02-27 04:34:00 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2019-02-27 08:09:21 +0000
commit34dce0edb1eafd1bb81d80d6bbb97ae1fd13c30b (patch)
tree271983e2eaa02da6de5fcde881d86cf38c569191
parent91067239c19e9cc7b0f583b481a487420c354cbf (diff)
pyflakes: Remove assigned but unread variables
-rw-r--r--src/osmo_gsm_tester/modem.py12
-rw-r--r--src/osmo_gsm_tester/osmo_nitb.py2
-rw-r--r--src/osmo_gsm_tester/template.py1
-rw-r--r--src/osmo_gsm_tester/util.py4
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