mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
test fix
This commit is contained in:
parent
6f7b448591
commit
78e06fdb42
2 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ Module for managing locales on POSIX-like systems.
|
|||
import logging
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
import salt.utils.locales
|
||||
import salt.utils.path
|
||||
|
@ -67,6 +68,10 @@ def _localectl_status():
|
|||
"""
|
||||
if salt.utils.path.which("localectl") is None:
|
||||
raise CommandExecutionError('Unable to find "localectl"')
|
||||
else:
|
||||
proc = subprocess.run(["localectl"], check=False, capture_output=True)
|
||||
if b"Failed to connect to bus: No such file or directory" in proc.stderr:
|
||||
raise CommandExecutionError('Command "localectl" is in a degraded state.')
|
||||
|
||||
ret = {}
|
||||
locale_ctl_out = (__salt__["cmd.run"]("localectl status") or "").strip()
|
||||
|
|
|
@ -23,7 +23,9 @@ def _check_systemctl():
|
|||
proc = subprocess.run(["systemctl"], capture_output=True, check=False)
|
||||
_check_systemctl.memo = (
|
||||
b"Failed to get D-Bus connection: No such file or directory" in proc.stderr
|
||||
or b"Failed to connect to bus: No such file or directory" in proc.stderr
|
||||
)
|
||||
print(repr(proc.stderr))
|
||||
return _check_systemctl.memo
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue