mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Ensure that current uses of BaseException are required
* In some cases, it appears that Exception should have been used instead as there's no need to catch sys.exit KeyboardInterrupt and similar. * In a few cases, it appears that BaseException is used because a library we depend on calls sys.exit() contrary to good coding design. Comment those so that we know that those have been audited and found to be correct and change to use (Exception, SystemExit) instead.
This commit is contained in:
@@ -321,7 +321,7 @@ def gather_vm_facts(content, vm):
|
||||
for item in vm.layout.disk:
|
||||
for disk in item.diskFile:
|
||||
facts['hw_files'].append(disk)
|
||||
except BaseException:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
facts['hw_folder'] = PyVmomi.get_vm_path(content, vm)
|
||||
@@ -968,7 +968,7 @@ class PyVmomi(object):
|
||||
folder_name = fp.name + '/' + folder_name
|
||||
try:
|
||||
fp = fp.parent
|
||||
except BaseException:
|
||||
except Exception:
|
||||
break
|
||||
folder_name = '/' + folder_name
|
||||
return folder_name
|
||||
|
||||
Reference in New Issue
Block a user