mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Blacken modified lines
This commit is contained in:
parent
a431557aa1
commit
d9c666a4d2
2 changed files with 7 additions and 5 deletions
|
@ -1109,7 +1109,9 @@ def _virtual(osdata):
|
|||
if ("virtual_subtype" not in grains) or (grains["virtual_subtype"] != "LXC"):
|
||||
if os.path.isfile("/proc/1/environ"):
|
||||
try:
|
||||
with salt.utils.files.fopen("/proc/1/environ", "r", errors="ignore") as fhr:
|
||||
with salt.utils.files.fopen(
|
||||
"/proc/1/environ", "r", errors="ignore"
|
||||
) as fhr:
|
||||
fhr_contents = fhr.read()
|
||||
if "container=lxc" in fhr_contents:
|
||||
grains["virtual"] = "container"
|
||||
|
@ -1961,7 +1963,9 @@ def os_data():
|
|||
grains["init"] = "systemd"
|
||||
except OSError:
|
||||
try:
|
||||
with salt.utils.files.fopen("/proc/1/cmdline", "r", errors="ignore") as fhr:
|
||||
with salt.utils.files.fopen(
|
||||
"/proc/1/cmdline", "r", errors="ignore"
|
||||
) as fhr:
|
||||
init_cmdline = fhr.read().replace("\x00", " ").split()
|
||||
except OSError:
|
||||
pass
|
||||
|
|
|
@ -3088,9 +3088,7 @@ def test_virtual_linux_proc_files_with_non_utf8_chars():
|
|||
|
||||
with patch("os.path.isfile", _is_file_mock), patch(
|
||||
"salt.utils.files.fopen", _mock_open
|
||||
), patch.object(
|
||||
salt.utils.path, "which", MagicMock(return_value=None)
|
||||
), patch.dict(
|
||||
), patch.object(salt.utils.path, "which", MagicMock(return_value=None)), patch.dict(
|
||||
core.__salt__,
|
||||
{
|
||||
"cmd.run_all": MagicMock(
|
||||
|
|
Loading…
Add table
Reference in a new issue