Fix assorted bugs found by pylint

This commit is contained in:
Jakub Hrozek
2011-01-25 18:46:26 +01:00
committed by Simo Sorce
parent 27da394c44
commit ab2ca8022e
17 changed files with 19 additions and 46 deletions

View File

@@ -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

View File

@@ -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']

View File

@@ -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: