Guest User

Untitled

a guest
Feb 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. diff --git a/salt/utils/vault.py b/salt/utils/vault.py
  2. index 0a96fbc1a1..98f71a107e 100644
  3. --- a/salt/utils/vault.py
  4. +++ b/salt/utils/vault.py
  5. @@ -98,7 +98,7 @@ def _get_vault_connection():
  6. Get the connection details for calling Vault, from local configuration if
  7. it exists, or from the master otherwise
  8. '''
  9. - if 'vault' in __opts__ and __opts__.get('__role', 'minion') == 'master':
  10. + def _use_local_config():
  11. log.debug('Using Vault connection details from local config')
  12. try:
  13. return {
  14. @@ -108,6 +108,11 @@ def _get_vault_connection():
  15. except KeyError as err:
  16. errmsg = 'Minion has "vault" config section, but could not find key "{0}" within'.format(err.message)
  17. raise salt.exceptions.CommandExecutionError(errmsg)
  18. +
  19. + if 'vault' in __opts__ and __opts__.get('__role', 'minion') == 'master':
  20. + return _use_local_config()
  21. + elif '_ssh_version' in __opts__:
  22. + return _use_local_config()
  23. else:
  24. log.debug('Contacting master for Vault connection details')
  25. return _get_token_and_url_from_master()
Add Comment
Please, Sign In to add comment