mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
paths: remove DEV_NULL
The platform-specific path to /dev/null is provided by the Python standard library in os.devnull. Replace all uses of paths.DEV_NULL with os.devnull and remove DEV_NULL. https://fedorahosted.org/freeipa/ticket/6474 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
a291c6ded9
commit
9117a5d5a6
@@ -1083,7 +1083,7 @@ def configure_sshd_config(fstore, options):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for candidate in candidates:
|
for candidate in candidates:
|
||||||
args = ['sshd', '-t', '-f', paths.DEV_NULL]
|
args = ['sshd', '-t', '-f', os.devnull]
|
||||||
for item in candidate.items():
|
for item in candidate.items():
|
||||||
args.append('-o')
|
args.append('-o')
|
||||||
args.append('%s=%s' % item)
|
args.append('%s=%s' % item)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class BasePathNamespace(object):
|
|||||||
SYSTEMCTL = "/bin/systemctl"
|
SYSTEMCTL = "/bin/systemctl"
|
||||||
TAR = "/bin/tar"
|
TAR = "/bin/tar"
|
||||||
BIN_TRUE = "/bin/true"
|
BIN_TRUE = "/bin/true"
|
||||||
DEV_NULL = "/dev/null"
|
|
||||||
DEV_STDIN = "/dev/stdin"
|
DEV_STDIN = "/dev/stdin"
|
||||||
AUTOFS_LDAP_AUTH_CONF = "/etc/autofs_ldap_auth.conf"
|
AUTOFS_LDAP_AUTH_CONF = "/etc/autofs_ldap_auth.conf"
|
||||||
ETC_DIRSRV = "/etc/dirsrv"
|
ETC_DIRSRV = "/etc/dirsrv"
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ def run(args, stdin=None, raiseonerr=True, nolog=(), env=None,
|
|||||||
if stdin:
|
if stdin:
|
||||||
p_in = subprocess.PIPE
|
p_in = subprocess.PIPE
|
||||||
if skip_output:
|
if skip_output:
|
||||||
p_out = p_err = open(paths.DEV_NULL, 'w')
|
p_out = p_err = open(os.devnull, 'w')
|
||||||
elif redirect_output:
|
elif redirect_output:
|
||||||
p_out = sys.stdout
|
p_out = sys.stdout
|
||||||
p_err = sys.stderr
|
p_err = sys.stderr
|
||||||
|
|||||||
Reference in New Issue
Block a user