Commit 52a6de46 authored by Hanspeter Spalinger's avatar Hanspeter Spalinger

fix variable scope

parent 5feecbf8
......@@ -697,6 +697,7 @@ class CronLineTimeAction(object):
self.time_field = time_field
self.user = user
self.command = command
self.check_passwd = check_passwd
def _CheckTimeField(self, log):
"""Virtual method to be implemented by subclasses to check time field."""
......@@ -720,7 +721,7 @@ class CronLineTimeAction(object):
log.LineError(log.MSG_INVALID_USER, 'Invalid username "%s"' % self.user)
elif re.search(r'[\s!"#$%&\'()*+,/:;<=>?@[\\\]^`{|}~]', self.user):
log.LineError(log.MSG_INVALID_USER, 'Invalid username "%s"' % self.user)
elif check_passwd:
elif self.check_passwd:
try:
pwd.getpwnam(self.user)
except KeyError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment