frostfs-testlib/src/frostfs_testlib/shell/command_inspectors.py
Yulia Kovshova 6d3b6f0f2f Rename neofs to frostfs
Signed-off-by: Yulia Kovshova <y.kovshova@yadro.com>
2023-02-16 17:26:12 +03:00

13 lines
362 B
Python

from frostfs_testlib.shell.interfaces import CommandInspector
class SudoInspector(CommandInspector):
"""Prepends command with sudo.
If command is already prepended with sudo, then has no effect.
"""
def inspect(self, command: str) -> str:
if not command.startswith("sudo"):
return f"sudo {command}"
return command