Skip to content

Commit

Permalink
Fix incorrect command formulation
Browse files Browse the repository at this point in the history
Mitigation of an error where instead of no argument an "empty argument"
was passed to `lscpu`

	lscpu ''

vs.

	lscpu

(cherry picked from commit a5bd254)
  • Loading branch information
dkubek authored and yuravk committed Aug 20, 2024
1 parent 7f52536 commit b35b376
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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)
Expand Down

0 comments on commit b35b376

Please sign in to comment.