diff options
author | Irina Truong <i.chernyavska@gmail.com> | 2018-07-26 05:05:44 +0000 |
---|---|---|
committer | Irina Truong <i.chernyavska@gmail.com> | 2018-07-26 05:09:23 +0000 |
commit | 9063f022568168fba643fc4d8e07e6b52af5539f (patch) | |
tree | 1b35c8980feacb7fcf7c490fd231cec895c38c5b | |
parent | 688f09c0916841d16697bc71b474b878830a83f8 (diff) |
Fixes keyring = False not honored.
-rw-r--r-- | pgcli/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index da17abf6..4219930f 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -179,6 +179,7 @@ class PGCli(object): self.on_error = c['main']['on_error'].upper() self.decimal_format = c['data_formats']['decimal'] self.float_format = c['data_formats']['float'] + self.keyring_enabled = c["main"].as_bool("keyring") self.pgspecial.pset_pager(self.config['main'].as_bool( 'enable_pager') and "on" or "off") @@ -263,7 +264,6 @@ class PGCli(object): msg += '\nCurrently set to: %s' % self.table_format yield (None, None, None, msg) - def info_connection(self, **_): if self.pgexecute.host.startswith('/'): host = 'socket "%s"' % self.pgexecute.host @@ -424,7 +424,7 @@ class PGCli(object): - prepare keyring as described at: https://keyring.readthedocs.io/en/stable/ - uninstall keyring: pip uninstall keyring - disable keyring in our configuration: add keyring = False to [main]""") - if not passwd and keyring and self.config["main"].get("keyring", True): + if not passwd and keyring and self.keyring_enabled: try: passwd = keyring.get_password('pgcli', key) except ( @@ -472,7 +472,7 @@ class PGCli(object): **kwargs) else: raise e - if passwd and keyring and self.config["main"].get("keyring", True): + if passwd and keyring and self.keyring_enabled: try: keyring.set_password('pgcli', key, passwd) except ( |