mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-17 16:37:33 +00:00
refactor: use module.run_command instead of subprocess
Ansible modules should use module.run_command instead of subprocess. This is flagged by the latest ansible-test Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
parent
2044cbf239
commit
d56563dc16
1 changed files with 4 additions and 3 deletions
|
|
@ -67,7 +67,6 @@ import os
|
|||
import re
|
||||
import shlex
|
||||
import socket
|
||||
import subprocess
|
||||
import time
|
||||
import traceback
|
||||
import logging
|
||||
|
|
@ -2684,7 +2683,8 @@ class Cmd_initscripts(Cmd):
|
|||
present and did not save any state about the corresponding interface.
|
||||
"""
|
||||
try:
|
||||
subprocess.call(
|
||||
# run_command returns rc, stdout, and stderr but we don't need them
|
||||
_rc, _stdout, _stderr = self.run_env.run_command(
|
||||
[
|
||||
"busctl",
|
||||
"--system",
|
||||
|
|
@ -2696,7 +2696,8 @@ class Cmd_initscripts(Cmd):
|
|||
"as",
|
||||
"1",
|
||||
path,
|
||||
]
|
||||
],
|
||||
handle_exceptions=False,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue