summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-01-25 18:46:26 +0100
committerSimo Sorce <ssorce@redhat.com>2011-01-25 14:01:36 -0500
commitab2ca8022e4bd89e87e0b7ce908022e6df350866 (patch)
tree2f2bde264c001886e90dfb10466539e8f8b75782 /ipalib
parent27da394c442e98334726a7aae7da885c840be350 (diff)
downloadfreeipa-ab2ca8022e4bd89e87e0b7ce908022e6df350866.tar.gz
freeipa-ab2ca8022e4bd89e87e0b7ce908022e6df350866.tar.xz
freeipa-ab2ca8022e4bd89e87e0b7ce908022e6df350866.zip
Fix assorted bugs found by pylint
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/cli.py11
-rw-r--r--ipalib/frontend.py2
-rw-r--r--ipalib/parameters.py7
-rw-r--r--ipalib/pkcs10.py2
-rw-r--r--ipalib/plugins/dns.py2
-rw-r--r--ipalib/plugins/group.py2
-rw-r--r--ipalib/plugins/host.py1
7 files changed, 10 insertions, 17 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 2d219b71..9dda1c27 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -620,17 +620,6 @@ class help(frontend.Local):
if module == __name__:
return
return module.split('.')[-1]
- # get representation in the form of 'base_module.bare_module.command()'
- r = repr(cmd_plugin_proxy)
- # skip base module part and the following dot
- start = r.find(self._PLUGIN_BASE_MODULE)
- if start == -1:
- # command module isn't a plugin module, it's a builtin
- return None
- start += len(self._PLUGIN_BASE_MODULE) + 1
- # parse bare module name
- end = r.find('.', start)
- return r[start:end]
def _get_module_topic(self, module_name):
if not sys.modules[module_name]:
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 567edfd1..58fd4d64 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -693,13 +693,13 @@ class Command(HasParam):
If the client minor version is less than or equal to the server
then let the request proceed.
"""
+ server_ver = version.LooseVersion(API_VERSION)
ver = version.LooseVersion(client_version)
if len(ver.version) < 2:
raise VersionError(cver=ver.version, sver=server_ver.version, server= self.env.xmlrpc_uri)
client_major = ver.version[0]
client_minor = ver.version[1]
- server_ver = version.LooseVersion(API_VERSION)
server_major = server_ver.version[0]
server_minor = server_ver.version[1]
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 0d6c6902..22b03212 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -1532,6 +1532,13 @@ class AccessTime(Str):
if value < 1 or value > 52:
raise ValueError('week of the year out of range')
+ def _check_doty(self, t):
+ if not t.isnumeric():
+ raise ValueError('day of the year non-numeric')
+ value = int(t)
+ if value < 1 or value > 365:
+ raise ValueError('day of the year out of range')
+
def _check_month_num(self, t):
if not t.isnumeric():
raise ValueError('month number non-numeric')
diff --git a/ipalib/pkcs10.py b/ipalib/pkcs10.py
index 25658273..29f9b352 100644
--- a/ipalib/pkcs10.py
+++ b/ipalib/pkcs10.py
@@ -83,8 +83,6 @@ if __name__ == '__main__':
# Read PEM request from stdin and print out its components
csrlines = sys.stdin.readlines()
- csrlines = fp.readlines()
- fp.close()
csr = ''.join(csrlines)
csr = load_certificate_request(csr)
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 69c38b26..af2ba4dd 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -369,7 +369,7 @@ class dnsrecord(LDAPObject):
),
)
- def is_pkey_zone_record(*keys):
+ def is_pkey_zone_record(self, *keys):
idnsname = keys[-1]
if idnsname == '@' or idnsname == ('%s.' % keys[-2]):
return True
diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py
index ecf5453e..078d535b 100644
--- a/ipalib/plugins/group.py
+++ b/ipalib/plugins/group.py
@@ -160,7 +160,7 @@ class group_del(LDAPDelete):
def_primary_group = config.get('ipadefaultprimarygroup', '')
def_primary_group_dn = group_dn = self.obj.get_dn(def_primary_group)
if dn == def_primary_group_dn:
- raise errors.DefaultGroup()
+ raise errors.DefaultGroupError()
group_attrs = self.obj.methods.show(
self.obj.get_primary_key_from_dn(dn), all=True
)['result']
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 3225a78a..0bc7947a 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -437,7 +437,6 @@ class host_del(LDAPDelete):
break
if not match:
raise errors.NotFound(reason=_('DNS zone %(zone)s not found' % dict(zone=domain)))
- raise e
# Get all forward resources for this host
records = api.Command['dnsrecord_find'](domain, idnsname=parts[0])['result']
for record in records: