mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
cloud roster: Work with custom conf dir
A path to salt-cloud config file is hardcoded into the cloud roster, so it won't work with custom conf dir. Remove the hardcoded path and construct it using __opts__['conf_file'].
This commit is contained in:
parent
b0501515cb
commit
dd1d3aac74
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613
|
|||
'host': preferred_ip,
|
||||
}
|
||||
|
||||
cloud_opts = salt.config.cloud_config('/etc/salt/cloud')
|
||||
cloud_opts = salt.config.cloud_config(
|
||||
os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud')
|
||||
)
|
||||
ssh_username = salt.utils.cloud.ssh_usernames({}, cloud_opts)
|
||||
if isinstance(ssh_username, string_types):
|
||||
ret['tgt']['user'] = ssh_username
|
||||
|
|
Loading…
Add table
Reference in a new issue