34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
|
From a5bd2546f748ddac4240b3a34b168e422ef78c99 Mon Sep 17 00:00:00 2001
|
||
|
From: David Kubek <dkubek@redhat.com>
|
||
|
Date: Wed, 24 Apr 2024 11:05:32 +0200
|
||
|
Subject: [PATCH 19/34] Fix incorrect command formulation
|
||
|
|
||
|
Mitigation of an error where instead of no argument an "empty argument"
|
||
|
was passed to `lscpu`
|
||
|
|
||
|
lscpu ''
|
||
|
|
||
|
vs.
|
||
|
|
||
|
lscpu
|
||
|
---
|
||
|
repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||
|
index 7451066a..db3f92d4 100644
|
||
|
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||
|
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||
|
@@ -12,7 +12,7 @@ PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-
|
||
|
|
||
|
def _get_lscpu_output(output_json=False):
|
||
|
try:
|
||
|
- result = run(['lscpu', '-J' if output_json else ''])
|
||
|
+ result = run(['lscpu'] + (['-J'] if output_json else []))
|
||
|
return result.get('stdout', '')
|
||
|
except (OSError, CalledProcessError):
|
||
|
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||
|
--
|
||
|
2.42.0
|
||
|
|