Catch more specific exceptions instead of any throwable
Conflicts:
TestON/drivers/common/cli/onosdriver.py
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index ab37367..75fc073 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -321,7 +321,7 @@
print response
try:
print self.handle.after
- except:
+ except TypeError:
pass
# TODO: do something with i
main.log.info( "Command '" + str( cmdStr ) + "' sent to "
@@ -2235,7 +2235,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2263,7 +2263,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2302,7 +2302,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2343,7 +2343,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2385,7 +2385,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2451,7 +2451,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2505,7 +2505,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2557,7 +2557,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2620,7 +2620,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2655,7 +2655,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -2729,7 +2729,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 27c2d92..ea38f63 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1819,7 +1819,7 @@
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
return None
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -1853,8 +1853,7 @@
except AssertionError:
main.log.error("Incorrect Config settings: " + verification)
-
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
@@ -1888,12 +1887,10 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
-
except AssertionError:
main.log.info("Settings did not post to ONOS")
main.log.error(varification)
-
- except:
+ except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.log.error(varification)
main.cleanup()
diff --git a/TestON/drivers/common/cli/quaggaclidriver.py b/TestON/drivers/common/cli/quaggaclidriver.py
index bcd83f6..1c63206 100644
--- a/TestON/drivers/common/cli/quaggaclidriver.py
+++ b/TestON/drivers/common/cli/quaggaclidriver.py
@@ -606,7 +606,7 @@
self.handle.sendline( "" )
# self.handle.expect( "config-router" )
self.handle.expect( "config-router", timeout=5 )
- except:
+ except Exception:
main.log.warn( "Probably not in config-router mode!" )
self.disconnect()
main.log.info( "Start to disable peer" )
@@ -615,7 +615,7 @@
try:
self.handle.sendline( cmd )
self.handle.expect( "bgpd", timeout=5 )
- except:
+ except Exception:
main.log.warn( "Failed to disable peer" )
self.disconnect()
@@ -626,7 +626,7 @@
self.handle.sendline( "" )
# self.handle.expect( "config-router" )
self.handle.expect( "config-router", timeout=5 )
- except:
+ except Exception:
main.log.warn( "Probably not in config-router mode!" )
self.disconnect()
main.log.info( "Start to disable peer" )
@@ -635,7 +635,7 @@
try:
self.handle.sendline( cmd )
self.handle.expect( "bgpd", timeout=5 )
- except:
+ except Exception:
main.log.warn( "Failed to enable peer" )
self.disconnect()