mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
This commit is contained in:
parent
5147e792d3
commit
3fba006207
320 changed files with 659 additions and 656 deletions
|
@ -38,7 +38,7 @@ try:
|
|||
from ansible.module_utils.network.cnos import cnos_errorcodes
|
||||
from ansible.module_utils.network.cnos import cnos_devicerules
|
||||
HAS_LIB = True
|
||||
except:
|
||||
except Exception:
|
||||
HAS_LIB = False
|
||||
from distutils.cmd import Command
|
||||
from ansible.module_utils._text import to_text
|
||||
|
@ -1372,7 +1372,7 @@ def enterEnableModeForDevice(enablePassword, timeout, obj):
|
|||
gotit = buff.find("#")
|
||||
if(gotit != -1):
|
||||
return retVal
|
||||
except:
|
||||
except Exception:
|
||||
retVal = retVal + "\n Error-101"
|
||||
flag = True
|
||||
if(retVal == ""):
|
||||
|
@ -1396,7 +1396,7 @@ def waitForDeviceResponse(command, prompt, timeout, obj):
|
|||
gotit = buff.find(prompt)
|
||||
if(gotit != -1):
|
||||
flag = True
|
||||
except:
|
||||
except Exception:
|
||||
# debugOutput(prompt)
|
||||
if prompt == "(yes/no)?":
|
||||
retVal = retVal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue