mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
Close all open filehandle (#50544)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
94a1d86d70
commit
db8702cdb8
21 changed files with 81 additions and 47 deletions
|
@ -195,7 +195,9 @@ class LinuxVirtual(Virtual):
|
|||
# Check whether this is a RHEV hypervisor (is vdsm running ?)
|
||||
for f in glob.glob('/proc/[0-9]*/comm'):
|
||||
try:
|
||||
if open(f).read().rstrip() == 'vdsm':
|
||||
with open(f) as virt_fh:
|
||||
comm_content = virt_fh.read().rstrip()
|
||||
if comm_content == 'vdsm':
|
||||
virtual_facts['virtualization_type'] = 'RHEV'
|
||||
break
|
||||
except Exception:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue