]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: do not use "l" for variable name 37695/head
authorKefu Chai <kchai@redhat.com>
Fri, 16 Oct 2020 10:51:04 +0000 (18:51 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 16 Oct 2020 10:56:09 +0000 (18:56 +0800)
see also https://www.flake8rules.com/rules/E741.html

also silences flake8 warnings like:

2: {tty:'./controllers/home.py:90:26: E741 ambiguous variable name 'l'':'./controllers/home.py:90:26: E741 ambiguous variable name 'l''}
2: {tty:'./controllers/logs.py:52:13: E741 ambiguous variable name 'l'':'./controllers/logs.py:52:13: E741 ambiguous variable name 'l''}
2: {tty:'./services/ganesha.py:36:40: E741 ambiguous variable name 'l'':'./services/ganesha.py:36:40: E741 ambiguous variable name 'l''}
2: 3     E741 ambiguous variable name 'l'

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/controllers/home.py
src/pybind/mgr/dashboard/controllers/logs.py
src/pybind/mgr/dashboard/services/ganesha.py

index 705d7c456c8793cf12b962c636358f3a63d39b7a..793b241dd75597ce63a9e0224b9c041af5a94a59 100644 (file)
@@ -87,7 +87,7 @@ class HomeController(BaseController, LanguageMixin):
         result.sort(key=lambda l: l[0])
         result.sort(key=lambda l: l[1], reverse=True)
         logger.debug("language preference: %s", result)
-        return [l[0] for l in result]
+        return [r[0] for r in result]
 
     def _language_dir(self, langs):
         for lang in langs:
index 9717552969e45f79c94e7f8d4c1a067d00b84178..97995110746f347433200f8b1cb2aeda4bb68f03 100644 (file)
@@ -49,8 +49,8 @@ class Logs(BaseController):
     def load_buffer(self, buf, channel_name):
         lines = CephService.send_command(
             'mon', 'log last', channel=channel_name, num=LOG_BUFFER_SIZE, level='debug')
-        for l in lines:
-            buf.appendleft(l)
+        for line in lines:
+            buf.appendleft(line)
 
     def initialize_buffers(self):
         if not self._log_initialized:
index 35a9b9a7ac17528afc2bfe8f949ec492fd7de670..128d5981a13930978c43797653f128e3cca5a710 100644 (file)
@@ -33,7 +33,7 @@ class Ganesha(object):
             raise NFSException("Ganesha config location is not configured. "
                                "Please set the GANESHA_RADOS_POOL_NAMESPACE "
                                "setting.")
-        location_list = [l.strip() for l in location_list_str.split(",")]
+        location_list = [loc.strip() for loc in location_list_str.split(",")]
         for location in location_list:
             cluster = None
             pool = None