Skip to content

Commit

Permalink
Rename _run_command() to _run_subprocess().
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Jul 20, 2022
1 parent 9e0b14c commit d1ba8ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def get_pretty_hostname(default: str = "no name set") -> str:
# NOTE: The `api` package also retrieves the pretty hostname.
# This logic must be kept in sync with the logic in `api`.
result = (
await _run_command(
await _run_subprocess(
command="hostnamectl",
args=["--pretty", "status"],
)
Expand Down Expand Up @@ -55,7 +55,7 @@ async def persist_pretty_hostname(name: str) -> str:
# Now that we've rewritten /etc/machine-info to contain the new pretty hostname,
# restart systemd-hostnamed so that commands like `hostnamectl status --pretty`
# pick it up immediately.
await _run_command(
await _run_subprocess(
command="systemctl", args=["reload-or-restart", "systemd-hostnamed"]
)

Expand Down Expand Up @@ -102,7 +102,7 @@ def _rewrite_machine_info_str(

# TODO(mm, 2022-07-18): Deduplicate with identical subprocess error-checking code
# in .avahi and .static_hostname modules.
async def _run_command(
async def _run_subprocess(
command: Union[str, bytes],
args: List[Union[str, bytes]],
) -> bytes:
Expand Down

0 comments on commit d1ba8ae

Please sign in to comment.