commit:     dd966401553f4632f60cb673327b9446fb326654
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  7 14:47:46 2018 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul  7 14:47:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=dd966401

gkeys/base.py: Fix args.email test for gkeys-ldap

gkeys-ldap does not use the email arg.
Prevents:

  File "/var/lib/gkeys/gentoo-keys/gkeys/gkeys/base.py", line 330, in setup
    if args.email:
AttributeError: 'Namespace' object has no attribute 'email'

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 gkeys/gkeys/base.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py
index 8aff933..48c8a4d 100644
--- a/gkeys/gkeys/base.py
+++ b/gkeys/gkeys/base.py
@@ -327,7 +327,7 @@ class CliBase(object):
         if args.config:
             self.config.defaults['config'] = args.config
             self.config.defaults['configdir'] = os.path.dirname(args.config)
-            if args.email:
+            if getattr(args, 'email', False):
                 configs = [self.config.defaults['config'], 
os.path.abspath(os.path.join(self.config.defaults['configdir'], "email.conf"))]
                 self.config.read_config(configs)
             else:

Reply via email to