mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Check to see if a path is a link, because it's likely that if it IS
a link, one of the other paths points to it. Ignore so we don't get duplicates.
This commit is contained in:
parent
8f0e866f1b
commit
8f12bdb1a0
1 changed files with 4 additions and 1 deletions
|
@ -148,7 +148,10 @@ def _get_systemd_services():
|
|||
return __context__[contextkey]
|
||||
ret = set()
|
||||
for path in SYSTEM_CONFIG_PATHS + LOCAL_CONFIG_PATH:
|
||||
if os.access(path, os.R_OK):
|
||||
# Make sure user has access to the path, and if the path is a link
|
||||
# it's likely that another entry in SYSTEM_CONFIG_PATHS or LOCAL_CONFIG_PATH
|
||||
# points to it, so we can ignore it.
|
||||
if os.access(path, os.R_OK) and not os.path.islink(path):
|
||||
for fullname in os.listdir(path):
|
||||
try:
|
||||
unit_name, unit_type = fullname.rsplit('.', 1)
|
||||
|
|
Loading…
Add table
Reference in a new issue