mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +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:
|
if root_dir is None:
|
||||||
root_dir = syspaths.ROOT_DIR
|
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
|
# Check for cached minion ID
|
||||||
id_cache = os.path.join(root_dir,
|
id_cache = os.path.join(root_dir,
|
||||||
syspaths.CONFIG_DIR.lstrip(syspaths.ROOT_DIR),
|
config_dir.lstrip('\\'),
|
||||||
'minion_id')
|
'minion_id')
|
||||||
try:
|
try:
|
||||||
with salt.utils.fopen(id_cache) as idf:
|
with salt.utils.fopen(id_cache) as idf:
|
||||||
|
Loading…
Reference in New Issue
Block a user