Skip to content
Browse files

minor fix

  • Loading branch information...
1 parent 8265da7 commit e6e07c129974f239e59ec28903a83e1b025041c9 @stedolan committed Nov 3, 2009
Showing with 4 additions and 3 deletions.
  1. +3 −3 nd.py
  2. +1 −0 sampledata.ldif
View
6 nd.py
@@ -132,7 +132,6 @@ def myself():
default_login_shell = "/bin/bash"
states = ['active','noshell','renew','bold','expired','dead']
- @staticmethod
def _has_disabled_shell(self):
sh = self.get_attribute("loginShell")
return sh is not None and sh != User.first_login_shell and sh.startswith(User.disabled_shells_base)
@@ -166,7 +165,7 @@ def set_state(self, newst):
return
if st == "noshell":
- if self.has_disabled_shell():
+ if self._has_disabled_shell():
prevstate = self.loginShell[len(User.disabled_shells_base):]
if newst != prevstate:
raise Exception("Trying to change state of %s from noshell to %s, although account was %s" % (self, newst, prevstate))
@@ -220,7 +219,7 @@ def get_correct_state(self):
s = "expired"
elif st == "noshell":
sh = self.get_attribute("loginShell")
- if not self.has_disabled_shell() and autorenew:
+ if not self._has_disabled_shell() and autorenew:
s = "active"
else:
s = "noshell"
@@ -266,6 +265,7 @@ def get_user(self):
def check(self):
assert 'tcdnetsoc-group' in self.objectClass
user = self.get_user()
+ assert user.exists()
assert user.gidNumber == self.gidNumber
assert len(self.member) == 1
assert user in self
View
1 sampledata.ldif
@@ -6,6 +6,7 @@ uid: mu
sn: Dolan
cn: Stephen Dolan
uidNumber: 1000
+gidNumber: 1000
tcdnetsoc-ISS-username: sdolan
tcdnetsoc-membership-year: 2007-2008
tcdnetsoc-membership-year: 2008-2009

0 comments on commit e6e07c1

Please sign in to comment.
Something went wrong with that request. Please try again.