Hello community, here is the log from the commit of package python-aedir for openSUSE:Factory checked in at 2017-02-19 01:04:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-aedir (Old) and /work/SRC/openSUSE:Factory/.python-aedir.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aedir" Changes: -------- --- /work/SRC/openSUSE:Factory/python-aedir/python-aedir.changes 2017-02-07 12:06:13.354235350 +0100 +++ /work/SRC/openSUSE:Factory/.python-aedir.new/python-aedir.changes 2017-02-19 01:04:29.370439039 +0100 @@ -1,0 +2,5 @@ +Sat Feb 11 14:38:57 UTC 2017 - [email protected] + +- update to 0.0.23 + +------------------------------------------------------------------- Old: ---- aedir-0.0.22.tar.gz aedir-0.0.22.tar.gz.asc New: ---- aedir-0.0.23.tar.gz aedir-0.0.23.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-aedir.spec ++++++ --- /var/tmp/diff_new_pack.Q8gFn5/_old 2017-02-19 01:04:29.746386213 +0100 +++ /var/tmp/diff_new_pack.Q8gFn5/_new 2017-02-19 01:04:29.750385652 +0100 @@ -17,7 +17,7 @@ Name: python-aedir -Version: 0.0.22 +Version: 0.0.23 Release: 0 Summary: Python module for AE-DIR License: Apache-2.0 ++++++ aedir-0.0.22.tar.gz -> aedir-0.0.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/PKG-INFO new/aedir-0.0.23/PKG-INFO --- old/aedir-0.0.22/PKG-INFO 2017-02-02 16:51:06.000000000 +0100 +++ new/aedir-0.0.23/PKG-INFO 2017-02-11 15:36:59.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: aedir -Version: 0.0.22 +Version: 0.0.23 Summary: AE-DIR library Home-page: https://ae-dir.com/python.html Author: Michael Stroeder @@ -27,3 +27,4 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP Requires: ldap +Requires: mailutil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/aedir/__init__.py new/aedir-0.0.23/aedir/__init__.py --- old/aedir-0.0.22/aedir/__init__.py 2017-02-02 16:36:32.000000000 +0100 +++ new/aedir-0.0.23/aedir/__init__.py 2017-02-11 14:05:47.000000000 +0100 @@ -362,7 +362,7 @@ if aeroot_dn is not None: self._aeroot_dn = aeroot_dn return aeroot_dn - naming_contexts = root_dse.get('namingContexts',[]) + naming_contexts = root_dse.get('namingContexts', []) while naming_contexts: # last element naming_context = naming_contexts.pop(-1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/aedir/pkginfo.py new/aedir-0.0.23/aedir/pkginfo.py --- old/aedir-0.0.22/aedir/pkginfo.py 2017-02-02 16:51:00.000000000 +0100 +++ new/aedir-0.0.23/aedir/pkginfo.py 2017-02-11 12:01:59.000000000 +0100 @@ -1,6 +1,6 @@ """ meta attributes for packaging which does not import any dependencies """ -__version__ = '0.0.22' +__version__ = '0.0.23' __author__ = 'Michael Stroeder <[email protected]>' __license__ = 'Apache License, Version 2.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/aedir/process.py new/aedir-0.0.23/aedir/process.py --- old/aedir-0.0.22/aedir/process.py 2017-01-16 17:10:27.000000000 +0100 +++ new/aedir-0.0.23/aedir/process.py 2017-02-11 15:33:43.000000000 +0100 @@ -3,6 +3,7 @@ """ # Imports from Python's standard lib +import socket import sys import os import time @@ -10,6 +11,8 @@ # Imports from python-ldap import ldap +import mailutil + import aedir # exported symbols @@ -32,8 +35,14 @@ def __init__(self): self.script_name = os.path.basename(sys.argv[0]) + self.host_fqdn = socket.getfqdn() self.logger = aedir.init_logger(self.script_name) - self.logger.debug('Starting %s %s', sys.argv[0], self.script_version) + self.logger.debug( + 'Starting %s %s on %s', + sys.argv[0], + self.script_version, + self.host_fqdn + ) self.logger.debug('Connecting to %r...', self.ldap_url) self.ldap_conn = aedir.AEDirObject(self.ldap_url, trace_level=self.pyldap_tracelevel) self.logger.debug( @@ -44,15 +53,49 @@ # not really started yet self.start_time = None self.run_counter = None + # no SMTP connection yet + self._smtp_conn = None def __enter__(self): return self def __exit__(self, *args): try: + self.logger.debug( + 'Close LDAP connection to %r', + self.ldap_conn.ldap_url_obj.initializeUrl() + ) self.ldap_conn.unbind_s() except ldap.LDAPError: pass + if self._smtp_conn is not None: + self.logger.debug( + 'Close SMTP connection to %r', + self._smtp_conn._remote_host + ) + self._smtp_conn.quit() + + def _smtp_connection( + self, + url, + local_hostname=None, + tls_args=None, + debug_level=0, + ): + """ + Open SMTP connection if not yet done before + """ + if self._smtp_conn is not None: + return self._smtp_conn + local_hostname = local_hostname or self.host_fqdn + self.logger.debug('Open SMTP connection to %r from %r', url, local_hostname) + self._smtp_conn = mailutil.smtp_connection( + url, + local_hostname=local_hostname, + tls_args=tls_args, + debug_level=debug_level, + ) + return self._smtp_conn def get_state(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/aedir.egg-info/PKG-INFO new/aedir-0.0.23/aedir.egg-info/PKG-INFO --- old/aedir-0.0.22/aedir.egg-info/PKG-INFO 2017-02-02 16:51:05.000000000 +0100 +++ new/aedir-0.0.23/aedir.egg-info/PKG-INFO 2017-02-11 15:36:59.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: aedir -Version: 0.0.22 +Version: 0.0.23 Summary: AE-DIR library Home-page: https://ae-dir.com/python.html Author: Michael Stroeder @@ -27,3 +27,4 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP Requires: ldap +Requires: mailutil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aedir-0.0.22/setup.py new/aedir-0.0.23/setup.py --- old/aedir-0.0.22/setup.py 2017-02-02 16:50:46.000000000 +0100 +++ new/aedir-0.0.23/setup.py 2017-02-11 15:35:15.000000000 +0100 @@ -41,7 +41,7 @@ download_url='https://pypi.python.org/pypi/aedir', py_modules=['aedir', 'aedir.pkginfo', 'aedir.process'], keywords=['AE-DIR', 'LDAP', 'OpenLDAP'], - requires=['ldap'], + requires=['ldap', 'mailutil'], #provides=['aedir (%s)' % aedir.__version__], classifiers=[ 'Development Status :: 5 - Production/Stable',
