From 3cb610e14584ccfcf6853e273a1042fd438db432 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Tue, 29 Mar 2022 11:28:26 +0530 Subject: [PATCH] ci: fixed pylint failure pylint was failing with used-before-assignment error fixed it by making the variables assignmet before it was used Also backward compatibility is removed from the ModuleNotFoundError import, as we auto installed python3 version on ceph standalone Signed-off-by: parth-gr (cherry picked from commit 339855f172f7b3ae0014d7863b08a3aa429a12a0) Signed-off-by: parth-gr --- deploy/examples/create-external-cluster-resources.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index 13723aceb..32f967a65 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -25,11 +25,7 @@ import subprocess from os import linesep as LINESEP from os import path -# backward compatibility with 2.x -try: - ModuleNotFoundError -except: - ModuleNotFoundError = ImportError +ModuleNotFoundError = ImportError try: import rados @@ -494,9 +490,9 @@ class RadosJSON: monitoring_endpoint_ip = monitoring_endpoint_ip_list_split[0] # rest of the ip-s are added to the 'standby_mgrs' list standby_mgrs.extend(monitoring_endpoint_ip_list_split[1:]) - + failed_ip = monitoring_endpoint_ip + try: - failed_ip = monitoring_endpoint_ip monitoring_endpoint_ip = self._convert_hostname_to_ip( monitoring_endpoint_ip) # collect all the 'stand-by' mgr ips