mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #15985 from alikins/vault_keyring_15984_fix
fix vault-keyring.py 'No [vault] section' error
This commit is contained in:
commit
d08fda9320
1 changed files with 5 additions and 4 deletions
9
contrib/vault/vault-keyring.py
Normal file → Executable file
9
contrib/vault/vault-keyring.py
Normal file → Executable file
|
@ -47,16 +47,17 @@
|
|||
import sys
|
||||
import getpass
|
||||
import keyring
|
||||
import ConfigParser
|
||||
|
||||
|
||||
import ansible.constants as C
|
||||
|
||||
|
||||
def main():
|
||||
parser = C.load_config_file()
|
||||
(parser,config_path) = C.load_config_file()
|
||||
try:
|
||||
username = parser.get('vault', 'username')
|
||||
except:
|
||||
sys.stderr.write('No [vault] section configured\n')
|
||||
except ConfigParser.NoSectionError:
|
||||
sys.stderr.write('No [vault] section configured in config file: %s\n' % config_path)
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == 'set':
|
||||
|
|
Loading…
Reference in a new issue