CR changes
This commit is contained in:
parent
5192953dd0
commit
a83c97519c
|
@ -48,17 +48,11 @@ class WindowsInfoCollector(InfoCollector):
|
||||||
def get_installed_packages(self):
|
def get_installed_packages(self):
|
||||||
LOG.info('Getting installed packages')
|
LOG.info('Getting installed packages')
|
||||||
|
|
||||||
packages = subprocess.Popen("dism /online /get-packages", shell=True, stdout=subprocess.PIPE).stdout.read()
|
packages = subprocess.check_output("dism /online /get-packages", shell=True)
|
||||||
try:
|
self.info["installed_packages"] = packages.decode('utf-8', errors='ignore')
|
||||||
self.info["installed_packages"] = packages.decode('utf-8')
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
self.info["installed_packages"] = packages.decode('raw-unicode-escape')
|
|
||||||
|
|
||||||
features = subprocess.Popen("dism /online /get-features", shell=True, stdout=subprocess.PIPE).stdout.read()
|
features = subprocess.check_output("dism /online /get-features", shell=True)
|
||||||
try:
|
self.info["installed_features"] = features.decode('utf-8', errors='ignore')
|
||||||
self.info["installed_features"] = features.decode('utf-8')
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
self.info["installed_features"] = features.decode('raw-unicode-escape')
|
|
||||||
|
|
||||||
LOG.debug('Got installed packages')
|
LOG.debug('Got installed packages')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue