From 947e5575f1f3892928b0e35e783e4d3c6ea0a74f Mon Sep 17 00:00:00 2001 From: Bernardo Decco Date: Tue, 21 Sep 2021 12:11:41 -0300 Subject: [PATCH] Re-enable important py3k checks for tsconfig Re-enabling some of the disabled tox warnings present on the pylint.rc file Re-enabling: W1505: deprecated-method Test Plan: Sanity test run on AIO-SX: PASS: test_system_health_pre_session[pods] PASS: test_system_health_pre_session[alarms] PASS: test_system_health_pre_session[system_apps] PASS: test_wr_analytics[deploy_and_remove] PASS: test_horizon_host_inventory_display PASS: test_lock_unlock_host[controller] PASS: test_pod_to_pod_connection PASS: test_pod_to_service_connection PASS: test_host_to_service_connection Story: 2006796 Task: 43382 Signed-off-by: Bernardo Decco Change-Id: Ia7a7b6c1479b2c02540131eeb913392505ca203a --- tsconfig/tsconfig/pylint.rc | 3 +-- tsconfig/tsconfig/tsconfig/tsconfig.py | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tsconfig/tsconfig/pylint.rc b/tsconfig/tsconfig/pylint.rc index 550c1671c7..8eb5b5dc15 100755 --- a/tsconfig/tsconfig/pylint.rc +++ b/tsconfig/tsconfig/pylint.rc @@ -112,9 +112,8 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # W0702 bare-except # W0703 broad except warning # W1201 logging-not-lazy -# W1505: deprecated-method # W1618: no-absolute-import -disable=C, R, W0603, W0612, W0613, W0702, W0703, W1201, W1505, W1618 +disable=C, R, W0603, W0612, W0613, W0702, W0703, W1201, W1618 [REPORTS] # Set the output format. Available formats are text, parseable, colorized, msvs diff --git a/tsconfig/tsconfig/tsconfig/tsconfig.py b/tsconfig/tsconfig/tsconfig/tsconfig.py index c42345d065..ecb1c08b5d 100644 --- a/tsconfig/tsconfig/tsconfig/tsconfig.py +++ b/tsconfig/tsconfig/tsconfig/tsconfig.py @@ -66,10 +66,10 @@ def _load(): # python3 parser to work in strict mode. if six.PY2: config = configparser.SafeConfigParser() + config.readfp(ini_fp) # pylint: disable=deprecated-method elif six.PY3: config = configparser.SafeConfigParser(strict=False) # pylint: disable=unexpected-keyword-arg - - config.readfp(ini_fp) + config.read_file(ini_fp) try: value = str(config.get('build_info', 'SW_VERSION')) @@ -85,7 +85,10 @@ def _load(): # for ConfigParser. So we'll fake it out. ini_str = u'[platform_conf]\n' + open(PLATFORM_CONF_FILE, 'r').read() ini_fp = io.StringIO(ini_str) - config.readfp(ini_fp) + if six.PY2: + config.readfp(ini_fp) # pylint: disable=deprecated-method + elif six.PY3: + config.read_file(ini_fp) try: value = str(config.get('platform_conf', 'nodetype'))