From e37b88dbda29d02655d66bb8d69744f78c6c9b6c Mon Sep 17 00:00:00 2001 From: kakwa Date: Tue, 31 Jan 2017 20:59:49 +0100 Subject: [PATCH] fix some errors in unused code --- ldapcherry/exceptions.py | 4 ++-- ldapcherry/ppolicy/simple.py | 6 +++--- misc/debug_ldapbackend.py | 1 - setup.py | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ldapcherry/exceptions.py b/ldapcherry/exceptions.py index 80d912f..0413f84 100644 --- a/ldapcherry/exceptions.py +++ b/ldapcherry/exceptions.py @@ -90,10 +90,10 @@ class PPolicyError(Exception): class MissingMainFile(Exception): def __init__(self, config): - self.rolefile = rolefile + self.config = config self.log = \ "fail to open main file '%(config)s'" % \ - {'rolefile': rolefile} + {'config': config} class MissingAttributesFile(Exception): diff --git a/ldapcherry/ppolicy/simple.py b/ldapcherry/ppolicy/simple.py index 2efb8e0..ce50ff0 100644 --- a/ldapcherry/ppolicy/simple.py +++ b/ldapcherry/ppolicy/simple.py @@ -31,9 +31,9 @@ class PPolicy(ldapcherry.ppolicy.PPolicy): def info(self): return \ - "* Minimum length: %(len)n\n" \ - "* Minimum number of uppercase characters: %(upper)n\n" \ - "* Minimum number of digits: %(digit)n" % { + "* Minimum length: %(len)d\n" \ + "* Minimum number of uppercase characters: %(upper)d\n" \ + "* Minimum number of digits: %(digit)d" % { 'upper': self.min_upper, 'len': self.min_length, 'digit': self.min_digit diff --git a/misc/debug_ldapbackend.py b/misc/debug_ldapbackend.py index 8f63f0e..37c8e0f 100644 --- a/misc/debug_ldapbackend.py +++ b/misc/debug_ldapbackend.py @@ -8,7 +8,6 @@ import pytest import sys from sets import Set from ldapcherry.backend.backendLdap import Backend -from ldapcherry import syslog_error from ldapcherry.exceptions import * import cherrypy import logging diff --git a/setup.py b/setup.py index 4c6a408..8e2fb1c 100755 --- a/setup.py +++ b/setup.py @@ -90,7 +90,6 @@ resources_files = get_list_files( data_dir, ) -as_option_root # add the configuration files if they don't exist if as_option_root() or not os.path.exists( config_dir):