mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-11 05:24:56 -05:00
Use os.path.isfile() and isdir()
Replace custom file_exists() and dir_exists() functions with proper functions from Python's stdlib. The change also gets rid of pylint's invalid bad-python3-import error, https://github.com/PyCQA/pylint/issues/1565 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
committed by
Stanislav Laznicka
parent
fad88b358b
commit
b29db07c3b
@@ -424,7 +424,7 @@ class SystemdService(PlatformService):
|
||||
self.service_instance(instance_name))
|
||||
|
||||
try:
|
||||
if not ipautil.dir_exists(srv_tgt):
|
||||
if not os.path.isdir(srv_tgt):
|
||||
os.mkdir(srv_tgt)
|
||||
os.chmod(srv_tgt, 0o755)
|
||||
if os.path.exists(srv_lnk):
|
||||
@@ -459,7 +459,7 @@ class SystemdService(PlatformService):
|
||||
self.service_instance(instance_name))
|
||||
|
||||
try:
|
||||
if ipautil.dir_exists(srv_tgt):
|
||||
if os.path.isdir(srv_tgt):
|
||||
if os.path.islink(srv_lnk):
|
||||
os.unlink(srv_lnk)
|
||||
ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"])
|
||||
|
||||
Reference in New Issue
Block a user