@@ -90,7 +90,7 @@ def delete_security_group(conn, sg_id):
9090 conn .network .find_security_group (name_or_id = sg_id )
9191 except ResourceNotFound :
9292 logger .debug (f"Security group { sg_id } was deleted successfully." )
93- except Exception as e :
93+ except Exception :
9494 logger .critical (f"Security group { sg_id } was not deleted successfully" )
9595 raise
9696
@@ -107,12 +107,12 @@ def altern_test_rules(connection: openstack.connection.Connection):
107107def test_rules (connection : openstack .connection .Connection ):
108108 try :
109109 rules = list (connection .network .default_security_group_rules ())
110- except ResourceNotFound as e :
110+ except ResourceNotFound :
111111 logger .info (
112112 "API call failed. OpenStack components might not be up to date. "
113113 "Falling back to old-style test method. "
114114 )
115- logger .debug (f "traceback" , exc_info = True )
115+ logger .debug ("traceback" , exc_info = True )
116116 altern_test_rules (connection )
117117 else :
118118 check_default_rules (rules )
@@ -129,7 +129,7 @@ def handle(self, record):
129129
130130def main ():
131131 parser = argparse .ArgumentParser (
132- description = "SCS Default Security Group Rules Checker"
132+ description = "SCS Default Security Group Rules Checker" ,
133133 )
134134 parser .add_argument (
135135 "--os-cloud" ,
@@ -138,7 +138,7 @@ def main():
138138 "to the OS_CLOUD environment variable" ,
139139 )
140140 parser .add_argument (
141- "--debug" , action = "store_true" , help = "Enable OpenStack SDK debug logging"
141+ "--debug" , action = "store_true" , help = "Enable debug logging" ,
142142 )
143143 args = parser .parse_args ()
144144 openstack .enable_logging (debug = args .debug )
0 commit comments