From b4579b875b0d7078c71e1eff21d83aa7946e3022 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Mon, 3 Dec 2018 15:15:55 -0600 Subject: [PATCH] Cleanup pylint unnecessary-pass warnings This commit cleans up pylint error: W0107 unnecessary-pass Python rules dictate that a pass statement is only needed if it is the only code in a particular block. These changes have no runtime impact on the code. Story: 2004515 Task: 28249 Change-Id: Ib805496c1123708cb67af82458f0b354a7b8e279 Signed-off-by: Al Bailey --- nfv/nfv-common/nfv_common/thread/_thread.py | 1 - nfv/nfv-tests/nfv_scenario_tests/main.py | 1 - nfv/nfv-vim/nfv_vim/vim.py | 1 - nfv/nfv-vim/nfv_vim/vim_api.py | 1 - nfv/nfv-vim/nfv_vim/vim_manage.py | 1 - nfv/nfv-vim/nfv_vim/vim_webserver.py | 1 - nfv/pylint.rc | 3 +-- nova-api-proxy/nova-api-proxy/nova_api_proxy/api_proxy.py | 1 - nova-api-proxy/pylint.rc | 3 +-- 9 files changed, 2 insertions(+), 11 deletions(-) diff --git a/nfv/nfv-common/nfv_common/thread/_thread.py b/nfv/nfv-common/nfv_common/thread/_thread.py index e12df8e1..40083149 100755 --- a/nfv/nfv-common/nfv_common/thread/_thread.py +++ b/nfv/nfv-common/nfv_common/thread/_thread.py @@ -222,7 +222,6 @@ def _thread_main(thread_name, progress_marker, debug_config, thread_worker, except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: DLOG.exception("%s" % e) diff --git a/nfv/nfv-tests/nfv_scenario_tests/main.py b/nfv/nfv-tests/nfv_scenario_tests/main.py index e429e3e4..a851e688 100755 --- a/nfv/nfv-tests/nfv_scenario_tests/main.py +++ b/nfv/nfv-tests/nfv_scenario_tests/main.py @@ -716,7 +716,6 @@ def process_main(): except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: print("Exception: %s" % e) diff --git a/nfv/nfv-vim/nfv_vim/vim.py b/nfv/nfv-vim/nfv_vim/vim.py index 5817f9c8..65946db8 100755 --- a/nfv/nfv-vim/nfv_vim/vim.py +++ b/nfv/nfv-vim/nfv_vim/vim.py @@ -166,7 +166,6 @@ def process_main(): except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: DLOG.exception("%s" % e) diff --git a/nfv/nfv-vim/nfv_vim/vim_api.py b/nfv/nfv-vim/nfv_vim/vim_api.py index e413100f..50feb55a 100755 --- a/nfv/nfv-vim/nfv_vim/vim_api.py +++ b/nfv/nfv-vim/nfv_vim/vim_api.py @@ -158,7 +158,6 @@ def process_main(): except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: print(e) diff --git a/nfv/nfv-vim/nfv_vim/vim_manage.py b/nfv/nfv-vim/nfv_vim/vim_manage.py index 9f7323a2..6de13f0a 100755 --- a/nfv/nfv-vim/nfv_vim/vim_manage.py +++ b/nfv/nfv-vim/nfv_vim/vim_manage.py @@ -67,7 +67,6 @@ def process_main(): except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: print(e) diff --git a/nfv/nfv-vim/nfv_vim/vim_webserver.py b/nfv/nfv-vim/nfv_vim/vim_webserver.py index 176b0e57..3b0c88e5 100755 --- a/nfv/nfv-vim/nfv_vim/vim_webserver.py +++ b/nfv/nfv-vim/nfv_vim/vim_webserver.py @@ -112,7 +112,6 @@ def process_main(): except KeyboardInterrupt: print("Keyboard Interrupt received.") - pass except Exception as e: print(e) diff --git a/nfv/pylint.rc b/nfv/pylint.rc index d3ce7a8c..7ca0e00f 100755 --- a/nfv/pylint.rc +++ b/nfv/pylint.rc @@ -26,7 +26,6 @@ load-plugins= # can either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). -# W0107 unnecessary-pass # W0120 useless-else-on-loop # W0125 using-constant-test # W0212 protected-access var starting with _ used outside class or descendant @@ -46,7 +45,7 @@ load-plugins= # W0622 redefined-builtin # W0703 broad except warning # W1401 anomalous-backslash-in-string -disable=C, R, W0107, W0120, W0125, W0212, W0221, W0223, W0231, W0235, W0311, +disable=C, R, W0120, W0125, W0212, W0221, W0223, W0231, W0235, W0311, W0401, W0403, W0404, W0511, W0603, W0612, W0613, W0621, W0622, W0703, W1401 diff --git a/nova-api-proxy/nova-api-proxy/nova_api_proxy/api_proxy.py b/nova-api-proxy/nova-api-proxy/nova_api_proxy/api_proxy.py index d9389066..d05f17db 100644 --- a/nova-api-proxy/nova-api-proxy/nova_api_proxy/api_proxy.py +++ b/nova-api-proxy/nova-api-proxy/nova_api_proxy/api_proxy.py @@ -91,7 +91,6 @@ def main(): except KeyboardInterrupt: LOG.info("Keyboard Interrupt received.") - pass except Exception as e: LOG.exception(e) diff --git a/nova-api-proxy/pylint.rc b/nova-api-proxy/pylint.rc index 8a2a5694..70b9d5ec 100755 --- a/nova-api-proxy/pylint.rc +++ b/nova-api-proxy/pylint.rc @@ -28,14 +28,13 @@ load-plugins= # it should appear only once). # E1101 no-member # E1121: Too many positional arguments for function call -# W0107 unnecessary-pass # W0404 reimported # W0601 Global variable %r undefined at the module level # W0603 Using the global statement warning # W0613 Unused argument warning # W0621 Redefining name %r from outer scope # W0703 broad except warning -disable=C, R, E1101, E1121, W0107, W0404, W0601, W0603, W0613, W0621, W0703 +disable=C, R, E1101, E1121, W0404, W0601, W0603, W0613, W0621, W0703 [REPORTS]