diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 09:04:13 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 09:04:13 +0200 |
commit | 3071301ee48117e25fd3baea683cc1e724ae6c76 (patch) | |
tree | 506ca35939abfd10fee95f1de80afa5a076e5a58 /pynslcd/netgroup.py | |
parent | 4c19151250e318fa38dac33e5db1397b9d95a43e (diff) |
simplify request handling by passing read parameters around in a dict instead of setting object properties (this mainly simplifies search filter building)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1455 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'pynslcd/netgroup.py')
-rw-r--r-- | pynslcd/netgroup.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pynslcd/netgroup.py b/pynslcd/netgroup.py index 21be7a8..0f44660 100644 --- a/pynslcd/netgroup.py +++ b/pynslcd/netgroup.py @@ -36,13 +36,13 @@ filter = '(objectClass=nisNetgroup)' class NetgroupRequest(common.Request): - def write(self, dn, attributes): + def write(self, dn, attributes, parameters): # get names and check against requested user name names = attributes['cn'] - if self.name: - if self.name not in names: + if 'cn' in parameters: + if parameters['cn'] not in names: return - names = ( self.name, ) + names = ( parameters['cn'], ) if not names: print 'Error: entry %s does not contain %s value' % (dn, attmap['cn']) # write the netgroup triples @@ -66,7 +66,6 @@ class NetgroupRequest(common.Request): class NetgroupByNameRequest(NetgroupRequest): action = constants.NSLCD_ACTION_NETGROUP_BYNAME - filter_attrs = dict(cn='name') - def read_parameters(self): - self.name = self.fp.read_string() + def read_parameters(self, fp): + return dict(cn=fp.read_string()) |