diff options
author | Tomas Babej <tbabej@redhat.com> | 2013-06-10 10:45:04 +0200 |
---|---|---|
committer | Alexander Bokovoy <abokovoy@redhat.com> | 2013-06-10 12:27:34 +0300 |
commit | f8de527d83245819cbfd34d86af2a93432561077 (patch) | |
tree | cf7c5a65d06a5217041d114b04156073631fa0a4 /ipalib/plugins | |
parent | d2b943f08b6fd49b7adccbf6fa84e7d63d8f08b1 (diff) | |
download | freeipa-f8de527d83245819cbfd34d86af2a93432561077.tar.gz freeipa-f8de527d83245819cbfd34d86af2a93432561077.tar.xz freeipa-f8de527d83245819cbfd34d86af2a93432561077.zip |
PEP8 fixes in idrange.py
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/idrange.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/ipalib/plugins/idrange.py b/ipalib/plugins/idrange.py index 257730986..abca49297 100644 --- a/ipalib/plugins/idrange.py +++ b/ipalib/plugins/idrange.py @@ -150,6 +150,7 @@ IDs,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config' has to be modified to match the new range. """) + class idrange(LDAPObject): """ Range object. @@ -230,7 +231,8 @@ class idrange(LDAPObject): if not options.get('all', False) or options.get('pkey_only', False): entry_attrs.pop('objectclass', None) - def check_ids_in_modified_range(self, old_base, old_size, new_base, new_size): + def check_ids_in_modified_range(self, old_base, old_size, new_base, + new_size): if new_base is None and new_size is None: # nothing to check return @@ -243,12 +245,12 @@ class idrange(LDAPObject): checked_intervals = [] low_diff = new_interval[0] - old_interval[0] if low_diff > 0: - checked_intervals.append( - (old_interval[0], min(old_interval[1], new_interval[0] - 1))) + checked_intervals.append((old_interval[0], + min(old_interval[1], new_interval[0] - 1))) high_diff = old_interval[1] - new_interval[1] if high_diff > 0: - checked_intervals.append( - (max(old_interval[0], new_interval[1] + 1), old_interval[1])) + checked_intervals.append((max(old_interval[0], new_interval[1] + 1), + old_interval[1])) if not checked_intervals: # range is equal or covers the entire old range, nothing to check @@ -458,7 +460,8 @@ class idrange_add(LDAPCreate): 'be used together')) # Validate SID as the one of trusted domains - self.obj.validate_trusted_domain_sid(entry_attrs['ipanttrusteddomainsid']) + self.obj.validate_trusted_domain_sid( + entry_attrs['ipanttrusteddomainsid']) # ipaNTTrustedDomainSID attribute not set, this is local domain range else: @@ -500,6 +503,7 @@ class idrange_add(LDAPCreate): keep_objectclass=True) return dn + class idrange_del(LDAPDelete): __doc__ = _('Delete an ID range.') @@ -534,6 +538,7 @@ class idrange_del(LDAPDelete): return dn + class idrange_find(LDAPSearch): __doc__ = _('Search for ranges.') @@ -543,7 +548,8 @@ class idrange_find(LDAPSearch): # Since all range types are stored within separate containers under # 'cn=ranges,cn=etc' search can be done on a one-level scope - def pre_callback(self, ldap, filters, attrs_list, base_dn, scope, *args, **options): + def pre_callback(self, ldap, filters, attrs_list, base_dn, scope, *args, + **options): assert isinstance(base_dn, DN) attrs_list.append('objectclass') return (filters, base_dn, ldap.SCOPE_ONELEVEL) @@ -553,6 +559,7 @@ class idrange_find(LDAPSearch): self.obj.handle_iparangetype(entry, options) return truncated + class idrange_show(LDAPRetrieve): __doc__ = _('Display information about a range.') @@ -566,6 +573,7 @@ class idrange_show(LDAPRetrieve): self.obj.handle_iparangetype(entry_attrs, options) return dn + class idrange_mod(LDAPUpdate): __doc__ = _('Modify ID range.') @@ -629,7 +637,7 @@ class idrange_mod(LDAPUpdate): self.obj.validate_trusted_domain_sid( entry_attrs['ipanttrusteddomainsid']) - # Add trusted AD domain range object class, if it wasn't there + # Add trusted AD domain range object class, if it wasn't there if not 'ipatrustedaddomainrange' in old_attrs['objectclass']: entry_attrs['objectclass'].append('ipatrustedaddomainrange') @@ -687,6 +695,7 @@ class idrange_mod(LDAPUpdate): self.obj.handle_iparangetype(entry_attrs, options) return dn + api.register(idrange) api.register(idrange_add) api.register(idrange_mod) |