* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-22 23:11 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-22 23:11 UTC (permalink / raw
To: gentoo-commits
commit: 30d9ea3f78767f5c788478bfd70f33ff9139041f
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 21 00:27:12 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Dec 22 22:58:09 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=30d9ea3f
gkeyldap/cli.py: Fix missed import of Action_Options
---
gkeys-ldap/gkeyldap/cli.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index 15f4dbd..5a1e141 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -12,7 +12,7 @@ from gkeys import seed
from gkeys.base import CliBase
from gkeys.config import GKeysConfig
from gkeyldap import connect, search
-from gkeyldap.actions import Actions, Available_Actions
+from gkeyldap.actions import Actions, Available_Actions, Action_Options
class Main(CliBase):
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: 9ed35221ea0fbeb9f79cb620239a7c5c4a5f43eb
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:28:25 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:28:25 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=9ed35221
gkeys-ldap/actions.py: Fix config.get() call to config.get_key()
---
gkeys-ldap/gkeyldap/actions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 815950d..212b027 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -86,7 +86,7 @@ class Actions(object):
self.logger.debug(
"MAIN: _action_updateseeds; got results :) converted to info")
if args.category:
- filename = self.config.get('seeds', args.category) + '.new'
+ filename = self.config.get_key('seeds', args.category) + '.new'
if not self.create_seedfile(info, filename):
self.logger.error("Developer seed file update failure: "
"Original seed file is intact & untouched.")
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: 1f8276dd70e3231af0bdf93fc0e822fb90ae5571
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:02:51 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:02:51 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=1f8276dd
gkeys-ldap: Pass in our logger instance to LdapSearch class
---
gkeys-ldap/gkeyldap/actions.py | 4 ++--
gkeys-ldap/gkeyldap/search.py | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index cea4648..c0f891f 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -56,7 +56,7 @@ class Actions(object):
def ldapsearch(self, args):
- l = LdapSearch()
+ l = LdapSearch(logger=self.logger)
self.logger.debug("MAIN: _action_ldapsearch; args = %s" % str(args))
self.output("Search... Establishing connection\n")
if not l.status:
@@ -75,7 +75,7 @@ class Actions(object):
def updateseeds(self, args):
- l = LdapSearch()
+ l = LdapSearch(logger=self.logger)
self.logger.debug("MAIN: _action_updateseeds; args = %s" % str(args))
self.output("Search... Establishing connection")
if not l.status:
diff --git a/gkeys-ldap/gkeyldap/search.py b/gkeys-ldap/gkeyldap/search.py
index 81a9048..708c2e2 100644
--- a/gkeys-ldap/gkeyldap/search.py
+++ b/gkeys-ldap/gkeyldap/search.py
@@ -16,17 +16,17 @@ except ImportError:
from gkeyldap.config import default_criteria, default_fields, UID
from gkeyldap.connect import LdapConnect
-from gkeys.log import logger
class LdapSearch(object):
'''Class to perform searches on the configured LDAP server
'''
- def __init__(self, fields=None, criteria=None):
+ def __init__(self, fields=None, criteria=None, logger=None):
self.fields = fields or default_fields
self.criteria = criteria or default_criteria
- logger.debug('LdapSearch: __init__; fields...: %s' % self.fields)
- logger.debug('LdapSearch: __init__; criteria.: %s' % self.criteria)
+ self.logger = logger
+ self.logger.debug('LdapSearch: __init__; fields...: %s' % self.fields)
+ self.logger.debug('LdapSearch: __init__; criteria.: %s' % self.criteria)
self.ldap_connection = LdapConnect().connect(action='Search')
self.status = True
if not self.ldap_connection:
@@ -36,19 +36,19 @@ class LdapSearch(object):
'''Perform the LDAP search
'''
if not target:
- logger.debug('LdapSearch: search; invalid target: "%s"' % target)
+ self.logger.debug('LdapSearch: search; invalid target: "%s"' % target)
return {}
if not fields:
fields = self.fields
else:
- logger.debug('LdapSearch: search; new fields: %s' % str(fields))
+ self.logger.debug('LdapSearch: search; new fields: %s' % str(fields))
if not criteria:
criteria = self.criteria
else:
- logger.debug('LdapSearch: search; new criteria: %s' % criteria)
+ self.logger.debug('LdapSearch: search; new criteria: %s' % criteria)
results = self.ldap_connection.search_s(criteria,
ldap.SCOPE_ONELEVEL, search_field % target, fields)
- #logger.debug('LdapSearch: search; result = %s' % str(results))
+ #self.logger.debug('LdapSearch: search; result = %s' % str(results))
return results
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: a1680becd7e3cd1599a23d23a609df681760f76c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:13:30 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:13:30 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=a1680bec
gkeys-ldap/actions.py: Update self.output for the CliBase function
---
gkeys-ldap/gkeyldap/actions.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index c0f891f..ee06673 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -58,17 +58,17 @@ class Actions(object):
def ldapsearch(self, args):
l = LdapSearch(logger=self.logger)
self.logger.debug("MAIN: _action_ldapsearch; args = %s" % str(args))
- self.output("Search... Establishing connection\n")
+ self.output('', "Search... Establishing connection\n")
if not l.status:
- self.output("Aborting Search... Connection failed")
+ self.output('', "Aborting Search... Connection failed")
return False
attr, target, search_field = self.get_args(args)
results = l.search(target, search_field)
devs = l.result2dict(results, gkey2ldap[attr])
for dev in sorted(devs):
- self.output(dev, devs[dev])
- self.output("============================================")
- self.output("Total number of developers in results:", len(devs))
+ self.output('', dev, devs[dev])
+ self.output('', "============================================")
+ self.output('', "Total number of developers in results:", len(devs))
self.logger.info("============================================")
self.logger.info("Total number of developers in results: %d" % len(devs))
return True
@@ -77,9 +77,9 @@ class Actions(object):
def updateseeds(self, args):
l = LdapSearch(logger=self.logger)
self.logger.debug("MAIN: _action_updateseeds; args = %s" % str(args))
- self.output("Search... Establishing connection")
+ self.output('', "Search... Establishing connection")
if not l.status:
- self.output("Aborting update... Connection failed")
+ self.output('', "Aborting update... Connection failed")
return False
results = l.search('*', UID)
info = l.result2dict(results, 'uid')
@@ -92,17 +92,17 @@ class Actions(object):
if not self.create_seedfile(info, filename):
self.logger.error("Developer seed file update failure: "
"Original seed file is intact & untouched.")
- self.output("Backing up existing file...")
+ self.output('', "Backing up existing file...")
status = updatefiles(self.config, self.logger)
if not status:
- self.output("Develope seed failed to update!")
+ self.output('', "Develope seed failed to update!")
return False
- self.output("Developer seed file updated!")
+ self.output('', "Developer seed file updated!")
return True
def create_seedfile(self, devs, filename):
- self.output("Creating seeds from LDAP data...")
+ self.output('', "Creating seeds from LDAP data...")
self.seeds = Seeds(filename, self.config)
count = 0
error_count = 0
@@ -117,9 +117,9 @@ class Actions(object):
count += 1
else:
error_count += 1
- self.output("Total number of seeds created:", count)
- self.output("Seeds created... Saving file: %s" % filename)
- self.output("Total number of Dev's with GPG errors:", error_count)
+ self.output('', "Total number of seeds created:", count)
+ self.output('', "Seeds created... Saving file: %s" % filename)
+ self.output('', "Total number of Dev's with GPG errors:", error_count)
self.logger.info("Total number of seeds created: %d" % count)
self.logger.info("Seeds created... Saving file: %s" % filename)
self.logger.info("Total number of Dev's with GPG errors: %d" % error_count)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: a57687cb1d083e056bfbefad55d69f5607bffd1c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:08:02 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:08:02 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=a57687cb
gkeys-ldap: Pass in our logger to LdapConnect class
---
gkeys-ldap/gkeyldap/connect.py | 18 +++++++++---------
gkeys-ldap/gkeyldap/search.py | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/connect.py b/gkeys-ldap/gkeyldap/connect.py
index 74e393c..6c80e4f 100644
--- a/gkeys-ldap/gkeyldap/connect.py
+++ b/gkeys-ldap/gkeyldap/connect.py
@@ -14,15 +14,15 @@ except ImportError:
raise
-from gkeys.log import logger
from gkeyldap.config import default_server
class LdapConnect(object):
'''Class to connect on the configured LDAP server'''
- def __init__(self, server=None):
+ def __init__(self, server=None, logger=None):
self.server = server or default_server
- logger.debug('LdapConnect: __init__; server...: %s' % self.server)
+ self.logger = logger
+ self.logger.debug('LdapConnect: __init__; server...: %s' % self.server)
self.ldap_connection = None
def connect(self, server=None, action='LDAP'):
@@ -30,21 +30,21 @@ class LdapConnect(object):
@param server: string URI path for the LDAP server
'''
- logger.info("%s... Establishing connection" % action)
+ self.logger.info("%s... Establishing connection" % action)
if server:
self.server = server
- logger.debug('LdapConnect: connect; new server: %s' % self.server)
+ self.logger.debug('LdapConnect: connect; new server: %s' % self.server)
try:
self.ldap_connection = ldap.initialize(self.server)
self.ldap_connection.set_option(ldap.OPT_X_TLS_DEMAND, True)
self.ldap_connection.start_tls_s()
self.ldap_connection.simple_bind_s()
except Exception as e:
- logger.error(
+ self.logger.error(
'LdapConnect: connect; failed to connect to server: %s' % self.server)
- logger.error("Exception was: %s" % str(e))
- logger.error("Aborting %s... Connection failed" % action)
+ self.logger.error("Exception was: %s" % str(e))
+ self.logger.error("Aborting %s... Connection failed" % action)
return False
- logger.debug(
+ self.logger.debug(
'LdapConnect: connect; connection: %s' % self.ldap_connection)
return self.ldap_connection
diff --git a/gkeys-ldap/gkeyldap/search.py b/gkeys-ldap/gkeyldap/search.py
index 708c2e2..1bce9e1 100644
--- a/gkeys-ldap/gkeyldap/search.py
+++ b/gkeys-ldap/gkeyldap/search.py
@@ -27,7 +27,7 @@ class LdapSearch(object):
self.logger = logger
self.logger.debug('LdapSearch: __init__; fields...: %s' % self.fields)
self.logger.debug('LdapSearch: __init__; criteria.: %s' % self.criteria)
- self.ldap_connection = LdapConnect().connect(action='Search')
+ self.ldap_connection = LdapConnect(logger=self.logger).connect(action='Search')
self.status = True
if not self.ldap_connection:
self.status = False
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: 017471ef799b9c7b467ef51521cddd76d4fdf89e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:38:13 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:38:13 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=017471ef
gkeys-ldap/actions.py: Update action return values to match what CliBase expects
---
gkeys-ldap/gkeyldap/actions.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 29d8bc7..1d8e848 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -71,7 +71,7 @@ class Actions(object):
self.output('', "Total number of developers in results:", len(devs))
self.logger.info("============================================")
self.logger.info("Total number of developers in results: %d" % len(devs))
- return True
+ return (True, ['Completed'])
def updateseeds(self, args):
@@ -96,7 +96,7 @@ class Actions(object):
self.output('', "Develope seed failed to update!")
return False
self.output('', "Developer seed file updated!")
- return True
+ return (True, ['Completed'])
def create_seedfile(self, devs, filename):
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: 58bc58f55f81cf76dc27e6766d11819acdf5fcaf
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:33:19 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:33:19 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=58bc58f5
gkeys-ldap/actions.py: Fix some outputs for errors and consistency
---
gkeys-ldap/gkeyldap/actions.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 212b027..29d8bc7 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -115,11 +115,11 @@ class Actions(object):
count += 1
else:
error_count += 1
- self.output('', "Total number of seeds created:", count)
- self.output('', "Seeds created... Saving file: %s" % filename)
- self.output('', "Total number of Dev's with GPG errors:", error_count)
- self.logger.info("Total number of seeds created: %d" % count)
- self.logger.info("Seeds created... Saving file: %s" % filename)
+ self.output('', "Total number of seeds created........: %s" % count)
+ self.output('', "Seeds created... Saving file.........: %s" % filename)
+ self.output('', "Total number of Dev's with GPG errors: %s" % error_count)
+ self.logger.info("Total number of seeds created........: %d" % count)
+ self.logger.info("Seeds created... Saving file.........: %s" % filename)
self.logger.info("Total number of Dev's with GPG errors: %d" % error_count)
return self.seeds.save()
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-25 20:43 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-25 20:43 UTC (permalink / raw
To: gentoo-commits
commit: 56a51ebfdf243c93e3b93c1ada1d84a95a04321e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 25 19:43:04 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 25 19:43:04 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=56a51ebf
gkeys-ldap/cli.py: Update print_results assignment for CliBase
---
gkeys-ldap/gkeyldap/cli.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index 5a1e141..fd29a94 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -28,7 +28,7 @@ class Main(CliBase):
"""
self.root = root or "/"
self.config = config or GKeysConfig(root=root)
- self.print_results = print_results
+ self.config.options['print_results'] = print_results
self.args = None
self.seeds = None
self.cli_config = {
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2014-12-26 18:37 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2014-12-26 18:37 UTC (permalink / raw
To: gentoo-commits
commit: 53710b89cbeca23164a6ad6e32f10c752f088a8c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 26 18:36:38 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Dec 26 18:36:38 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=53710b89
gkeyldap/cli.py: Remove unused imports
---
gkeys-ldap/gkeyldap/cli.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index c85176f..b4a9904 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -6,12 +6,9 @@ from __future__ import print_function
import sys
-from gkeys import config
-from gkeys import seed
from gkeys.base import CliBase
from gkeys.config import GKeysConfig
-from gkeyldap import connect, search
from gkeyldap.actions import (Actions, Available_Actions, Action_Options,
Action_Map)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-01-05 23:12 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-01-05 23:12 UTC (permalink / raw
To: gentoo-commits
commit: cf22af68362e06c110fe77d5120df8140668c675
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 5 09:12:41 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 5 22:14:36 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=cf22af68
gkeyldap/actions.py: Add generated default uid to seed data
---
gkeys-ldap/gkeyldap/actions.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 45fff09..27c961d 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -182,6 +182,7 @@ class Actions(object):
keyinfo.pop('keyid', None)
keyinfo.pop('longkeyid', None)
keyinfo['keys'] = keyinfo['fingerprint']
+ keyinfo['uid'] = ["%s <%s@gentoo.org>" % (info['cn'][0], info['uid'][0])]
return keyinfo
return None
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-01-05 23:12 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-01-05 23:12 UTC (permalink / raw
To: gentoo-commits
commit: 9a61f63d51501ae11e4ce989df0615d62f836d2a
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 5 01:28:40 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 5 22:15:19 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=9a61f63d
gkeyldap: fix missed Seeds init logger param.
---
gkeys-ldap/gkeyldap/actions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 27c961d..dde2bc8 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -117,7 +117,7 @@ class Actions(object):
def create_seedfile(self, devs, filename):
self.output('', "Creating seeds from LDAP data...")
- self.seeds = Seeds(filename, self.config)
+ self.seeds = Seeds(filename, self.config, self.logger)
count = 0
error_count = 0
for dev in sorted(devs):
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-01-05 23:12 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-01-05 23:12 UTC (permalink / raw
To: gentoo-commits
commit: 759bb928c8651ee0ac0a0cac6f17cfda25905b93
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 5 01:24:33 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 5 22:15:19 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=759bb928
gkeyldap: missed os import
---
gkeys-ldap/gkeyldap/cli.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index 0bca7c7..68e99fa 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -3,7 +3,7 @@
from __future__ import print_function
-
+import os
import sys
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-01-05 23:12 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-01-05 23:12 UTC (permalink / raw
To: gentoo-commits
commit: 8e07d01d44825fdd10d2354d79ed4b06c9bfc856
Author: Pavlos Ratis <dastergon <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 5 19:42:53 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 5 22:21:53 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=8e07d01d
gkeyldap: redundancy to ldap slaves
---
gkeys-ldap/gkeyldap/config.py | 4 ++--
gkeys-ldap/gkeyldap/connect.py | 27 ++++++++++++++++-----------
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/config.py b/gkeys-ldap/gkeyldap/config.py
index 6e22a5c..f7fb837 100644
--- a/gkeys-ldap/gkeyldap/config.py
+++ b/gkeys-ldap/gkeyldap/config.py
@@ -1,8 +1,8 @@
#
#-*- coding:utf-8 -*-
-
-default_server = 'ldap://ldap1.gentoo.org'
+# Redundancy -- ldap{1,2,3,4}
+default_server = ['ldap://ldap%d.gentoo.org' % i for i in xrange(1,5)]
# add uid to the results so you don't have to
# separate it out of the results tuple[0] value
default_fields = ['uid', 'cn', 'mail', 'gentooStatus', 'gpgkey', 'gpgfingerprint']
diff --git a/gkeys-ldap/gkeyldap/connect.py b/gkeys-ldap/gkeyldap/connect.py
index 6c80e4f..9df6e24 100644
--- a/gkeys-ldap/gkeyldap/connect.py
+++ b/gkeys-ldap/gkeyldap/connect.py
@@ -20,7 +20,7 @@ class LdapConnect(object):
'''Class to connect on the configured LDAP server'''
def __init__(self, server=None, logger=None):
- self.server = server or default_server
+ self.server = server or default_server[0]
self.logger = logger
self.logger.debug('LdapConnect: __init__; server...: %s' % self.server)
self.ldap_connection = None
@@ -34,16 +34,21 @@ class LdapConnect(object):
if server:
self.server = server
self.logger.debug('LdapConnect: connect; new server: %s' % self.server)
- try:
- self.ldap_connection = ldap.initialize(self.server)
- self.ldap_connection.set_option(ldap.OPT_X_TLS_DEMAND, True)
- self.ldap_connection.start_tls_s()
- self.ldap_connection.simple_bind_s()
- except Exception as e:
- self.logger.error(
- 'LdapConnect: connect; failed to connect to server: %s' % self.server)
- self.logger.error("Exception was: %s" % str(e))
- self.logger.error("Aborting %s... Connection failed" % action)
+ connection = True
+ for ldap_slave in self.server:
+ try:
+ self.ldap_connection = ldap.initialize(self.server)
+ self.ldap_connection.set_option(ldap.OPT_X_TLS_DEMAND, True)
+ self.ldap_connection.start_tls_s()
+ self.ldap_connection.simple_bind_s()
+ except Exception as e:
+ self.logger.error(
+ 'LdapConnect: connect; failed to connect to server: %s' % self.server)
+ self.logger.error("Exception was: %s" % str(e))
+ self.logger.error("Connecting to the next LDAP slave...")
+ connection = False
+ continue
+ if not connection:
return False
self.logger.debug(
'LdapConnect: connect; connection: %s' % self.ldap_connection)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-02-11 17:37 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-02-11 17:37 UTC (permalink / raw
To: gentoo-commits
commit: 1f30ab54e6fbd83aa329173ee01117d526f842ea
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 14 06:20:32 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jan 31 03:43:48 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=1f30ab54
gkeys-ldap: Add version info in cli.py, update version
---
gkeys-ldap/gkeyldap/__init__.py | 2 +-
gkeys-ldap/gkeyldap/cli.py | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/__init__.py b/gkeys-ldap/gkeyldap/__init__.py
index 9789d69..afc133e 100644
--- a/gkeys-ldap/gkeyldap/__init__.py
+++ b/gkeys-ldap/gkeyldap/__init__.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-__version__ = 'Git'
+__version__ = '0.1'
__license__ = 'GPLv2'
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index 68e99fa..b134ed9 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -7,6 +7,7 @@ import os
import sys
+from gkeys import __version__
from gkeys.base import CliBase
from gkeys.config import GKeysConfig
from gkeyldap.actions import (Actions, Available_Actions, Action_Map)
@@ -36,6 +37,7 @@ class Main(CliBase):
'description': 'Gentoo-keys LDAP interface and seed file generator program',
'epilog': '''CAUTION: adding UNTRUSTED keys can be HAZARDOUS to your system!'''
}
+ self.version = __version__
def __call__(self, args=None):
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-03-17 19:51 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-03-17 19:51 UTC (permalink / raw
To: gentoo-commits
commit: 15298629aee8ae561c409718b8903726fcba330a
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 12 00:15:20 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 12 00:15:20 2015 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=15298629
gkeyldap/actions.py: Comment out longkeyid check
The keyid and longkeyid's are being removed soon.
With the fix-fp.sh script removing them, There are more and more false positives for errors.
gkeys-ldap/gkeyldap/actions.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 3f07829..7e951e0 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -242,12 +242,12 @@ class Actions(object):
else:
gpgkey = 'Missing or Bad fingerprint from LDAP info'
is_good = False
- if not keyinfo['longkeyid']:
- self.logger.error('ERROR in ldap info for: %s, %s'
- % (info['uid'][0], info['cn'][0]))
- self.logger.error(' A valid keyid, longkeyid or fingerprint '
- 'was not found for %s : gpgkey = %s' % (info['cn'][0], gpgkey))
- is_good = False
+ #if not keyinfo['longkeyid']:
+ #self.logger.error('ERROR in ldap info for: %s, %s'
+ #% (info['uid'][0], info['cn'][0]))
+ #self.logger.error(' A valid keyid, longkeyid or fingerprint '
+ #'was not found for %s : gpgkey = %s' % (info['cn'][0], gpgkey))
+ #is_good = False
return (keyinfo, is_good)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-03-24 3:13 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-03-24 3:13 UTC (permalink / raw
To: gentoo-commits
commit: f236426ca3977317586278b399406529f3975825
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 24 03:12:50 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Mar 24 03:12:50 2015 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=f236426c
gkeyldap/actions.py: Ignore 'undefined' for the keyid,longkeyid fields.
Interim change until the keyid's and longkeyid's are dropped from LDAP.
gkeys-ldap/gkeyldap/actions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 7e951e0..9558ed0 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -206,7 +206,7 @@ class Actions(object):
keyid_found = True
elif values and attr in ['fingerprint']:
values = [v.replace(' ', '') for v in values]
- if 'undefined' in values:
+ if 'undefined' in values and attr not in ['keyid', 'longkeyid']:
self.logger.error('ERROR in LDAP info for: %s, %s'
% (info['uid'][0], info['cn'][0]))
self.logger.error(' %s = "undefined"' % (field))
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2015-05-31 5:03 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2015-05-31 5:03 UTC (permalink / raw
To: gentoo-commits
commit: c87ffff6633693275ca5bbb67f81102bd2838123
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 20 17:43:45 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May 30 23:25:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=c87ffff6
gkeys-ldap: Remove keyid/longkeyid from ldap search info
gkeys-ldap/gkeyldap/actions.py | 42 ++++--------------------------------------
gkeys-ldap/gkeyldap/config.py | 5 +----
2 files changed, 5 insertions(+), 42 deletions(-)
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py
index 9558ed0..9d7a231 100644
--- a/gkeys-ldap/gkeyldap/actions.py
+++ b/gkeys-ldap/gkeyldap/actions.py
@@ -142,7 +142,7 @@ class Actions(object):
@staticmethod
def get_args(args):
- for attr in ['nick', 'name', 'gpgkey', 'fingerprint', 'status']:
+ for attr in ['nick', 'name', 'fingerprint', 'status']:
if attr:
target = getattr(args, attr)
search_field = gkey2SEARCH[attr]
@@ -162,7 +162,7 @@ class Actions(object):
% (info['uid'][0], info['cn'][0]))
self.logger.debug(' MISSING or EMPTY LDAP field ' +
'[%s] GPGKey field [%s]' % (field, attr))
- if attr in ['fingerprint', 'keyid', 'longkeyid']:
+ if attr in ['fingerprint']:
keyid_missing = True
else:
is_good = False
@@ -172,15 +172,11 @@ class Actions(object):
if is_good:
if keyinfo['fingerprint']: # fingerprints exist check
is_ok = self._check_fingerprint_integrity(info, keyinfo)
- is_match = self._check_id_fingerprint_match(info, keyinfo)
- if not is_ok or not is_match:
+ if not is_ok:
is_good = False
if is_good:
# some developers add lowercase fingerprints
keyinfo['fingerprint'] = [key.upper() for key in keyinfo['fingerprint']]
- # drop keyid and longkeyid
- keyinfo.pop('keyid', None)
- keyinfo.pop('longkeyid', None)
keyinfo['keys'] = keyinfo['fingerprint']
keyinfo['uid'] = ["%s <%s@gentoo.org>" % (info['cn'][0], info['uid'][0])]
return keyinfo
@@ -200,11 +196,7 @@ class Actions(object):
values = info[field]
# strip errant line feeds
values = [y.strip('\n') for y in values]
- # separate out short/long key id's
- if values and attr in ['keyid', 'longkeyid']:
- if len(get_key_ids(attr, values)):
- keyid_found = True
- elif values and attr in ['fingerprint']:
+ if values and attr in ['fingerprint']:
values = [v.replace(' ', '') for v in values]
if 'undefined' in values and attr not in ['keyid', 'longkeyid']:
self.logger.error('ERROR in LDAP info for: %s, %s'
@@ -242,35 +234,9 @@ class Actions(object):
else:
gpgkey = 'Missing or Bad fingerprint from LDAP info'
is_good = False
- #if not keyinfo['longkeyid']:
- #self.logger.error('ERROR in ldap info for: %s, %s'
- #% (info['uid'][0], info['cn'][0]))
- #self.logger.error(' A valid keyid, longkeyid or fingerprint '
- #'was not found for %s : gpgkey = %s' % (info['cn'][0], gpgkey))
- #is_good = False
return (keyinfo, is_good)
- def _check_id_fingerprint_match(self, info, keyinfo):
- # assume it's good until found an error is found
- is_good = True
- for attr in ['keyid', 'longkeyid']:
- # skip blank id field
- if not keyinfo[attr]:
- continue
- for y in keyinfo[attr]:
- index = len(y.lstrip('0x'))
- if y.lstrip('0x').upper() not in \
- [x[-index:].upper() for x in keyinfo['fingerprint']]:
- self.logger.error('ERROR in LDAP info for: %s, %s'
- %(info['uid'][0], info['cn'][0]))
- self.logger.error(' ' + str(keyinfo))
- self.logger.error(' GPGKey id %s not found in the '
- % y.lstrip('0x') + 'listed fingerprint(s)')
- is_good = False
- return is_good
-
-
def _check_fingerprint_integrity(self, info, keyinfo):
# assume it's good until found an error is found
is_good = True
diff --git a/gkeys-ldap/gkeyldap/config.py b/gkeys-ldap/gkeyldap/config.py
index f7fb837..fe56e78 100644
--- a/gkeys-ldap/gkeyldap/config.py
+++ b/gkeys-ldap/gkeyldap/config.py
@@ -5,15 +5,13 @@
default_server = ['ldap://ldap%d.gentoo.org' % i for i in xrange(1,5)]
# add uid to the results so you don't have to
# separate it out of the results tuple[0] value
-default_fields = ['uid', 'cn', 'mail', 'gentooStatus', 'gpgkey', 'gpgfingerprint']
+default_fields = ['uid', 'cn', 'mail', 'gentooStatus', 'gpgfingerprint']
default_criteria = 'ou=devs,dc=gentoo,dc=org'
# establish a ldap fields to GKEY._fields map
gkey2ldap = {
'nick': 'uid',
'name': 'cn',
- 'keyid': 'gpgkey',
- 'longkeyid': 'gpgkey',
# map the uid to keydir, since we want
# dev keydir to be separate from each other
'keydir': 'uid',
@@ -33,7 +31,6 @@ gkey2SEARCH = {
'nick': UID,
'name': CN,
'status': STATUS,
- 'keyid': GPGKEY,
'mail': MAIL,
'fingerprint': GPGFINGERPRINT,
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2016-12-23 19:55 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2016-12-23 19:55 UTC (permalink / raw
To: gentoo-commits
commit: a7919fc85ade88af4eae136c7f7e662225e4bcb8
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 19:55:05 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 19:55:05 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=a7919fc8
gkeys-ldap: Add missed CliBase.__init__() call
gkeys-ldap/gkeyldap/cli.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py
index 4d38485..4f17725 100644
--- a/gkeys-ldap/gkeyldap/cli.py
+++ b/gkeys-ldap/gkeyldap/cli.py
@@ -25,6 +25,7 @@ class Main(CliBase):
@param config: optional GKeysConfig instance, For API use
@param print_results: optional boolean, for API use
"""
+ CliBase.__init__(self)
self.root = root or "/"
self.config = config or GKeysConfig(root=root)
self.config.options['print_results'] = print_results
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/
@ 2018-07-07 14:05 Brian Dolbec
0 siblings, 0 replies; 19+ messages in thread
From: Brian Dolbec @ 2018-07-07 14:05 UTC (permalink / raw
To: gentoo-commits
commit: 4dddb4672aed28901ad6de1db5e520d73720a898
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 7 13:52:50 2018 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 7 13:52:50 2018 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=4dddb467
gkeyldap config.py: py3 update xrange ==> range
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
gkeys-ldap/gkeyldap/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gkeys-ldap/gkeyldap/config.py b/gkeys-ldap/gkeyldap/config.py
index fe56e78..a2ef400 100644
--- a/gkeys-ldap/gkeyldap/config.py
+++ b/gkeys-ldap/gkeyldap/config.py
@@ -2,7 +2,7 @@
#-*- coding:utf-8 -*-
# Redundancy -- ldap{1,2,3,4}
-default_server = ['ldap://ldap%d.gentoo.org' % i for i in xrange(1,5)]
+default_server = ['ldap://ldap%d.gentoo.org' % i for i in range(1,5)]
# add uid to the results so you don't have to
# separate it out of the results tuple[0] value
default_fields = ['uid', 'cn', 'mail', 'gentooStatus', 'gpgfingerprint']
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2018-07-07 14:06 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-25 20:43 [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-ldap/gkeyldap/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2018-07-07 14:05 Brian Dolbec
2016-12-23 19:55 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-03-24 3:13 Brian Dolbec
2015-03-17 19:51 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2014-12-26 18:37 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-22 23:11 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox