From 2e3d47b7b8db69edb5d550ccc4a46fd6512fc031 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 17 Apr 2020 16:59:48 +0200 Subject: Avoid writting /software output to a file --- src/virtual/ogOperations.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/virtual') diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py index a9cf06b..bc18dd4 100644 --- a/src/virtual/ogOperations.py +++ b/src/virtual/ogOperations.py @@ -358,11 +358,7 @@ class OgVirtualOperations: software += [h.node_name(x) for x in h.node_children(key)] os.remove('win_reg') - with open(path, 'w+') as f: - f.seek(0) - for program in software: - f.write(f'{program}\n') - f.truncate() + return '\n'.join(software) def parse_pci(self, path='/usr/share/misc/pci.ids'): data = {} -- cgit v1.2.3-18-g5258