Change in osmo-gsm-tester[master]: pyflakes: Remove assigned but unread variables

Holger Freyther gerrit-no-reply at lists.osmocom.org
Fri Mar 1 15:08:52 UTC 2019


Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/13071 )

Change subject: pyflakes: Remove assigned but unread variables
......................................................................

pyflakes: Remove assigned but unread variables

Change-Id: Ie257ac051739ea6f846d1aac2c8f778638b5f8a6
---
M src/osmo_gsm_tester/modem.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/template.py
M src/osmo_gsm_tester/util.py
4 files changed, 8 insertions(+), 11 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, approved
  Holger Freyther: Verified



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 @@
     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 @@
         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 @@
             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 @@
         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 @@
     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 @@
             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 @@
             if words[i] == 'src':
                 return words[i+1]
             i += 1
-    except Exception as e:
+    except Exception:
         pass
     return None
 

-- 
To view, visit https://gerrit.osmocom.org/13071
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie257ac051739ea6f846d1aac2c8f778638b5f8a6
Gerrit-Change-Number: 13071
Gerrit-PatchSet: 2
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190301/044b5696/attachment.html>


More information about the gerrit-log mailing list