mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Properly determine conf_dir
lstrip() strips each char independently. Not the whole string as a whole
This commit is contained in:
parent
d5eec7edc1
commit
b450f2ea86
@ -684,9 +684,13 @@ def get_id(root_dir=None, minion_id=False):
|
||||
if root_dir is None:
|
||||
root_dir = syspaths.ROOT_DIR
|
||||
|
||||
config_dir = syspaths.CONFIG_DIR
|
||||
if config_dir.startswith(root_dir):
|
||||
config_dir = config_dir.split(root_dir, 1)[-1]
|
||||
|
||||
# Check for cached minion ID
|
||||
id_cache = os.path.join(root_dir,
|
||||
syspaths.CONFIG_DIR.lstrip(syspaths.ROOT_DIR),
|
||||
config_dir.lstrip('\\'),
|
||||
'minion_id')
|
||||
try:
|
||||
with salt.utils.fopen(id_cache) as idf:
|
||||
|
Loading…
Reference in New Issue
Block a user