/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

* mandos (Client.checked_ok): Bug fix: Handle disabled client.

Show diffs side-by-side

added added

removed removed

Lines of Context:
464
464
        if timeout is None:
465
465
            timeout = self.timeout
466
466
        self.last_checked_ok = datetime.datetime.utcnow()
467
 
        gobject.source_remove(self.disable_initiator_tag)
468
 
        self.disable_initiator_tag = (gobject.timeout_add
469
 
                                      (_timedelta_to_milliseconds
470
 
                                       (timeout), self.disable))
471
 
        self.expires = datetime.datetime.utcnow() + timeout
 
467
        if self.disable_initiator_tag is not None:
 
468
            gobject.source_remove(self.disable_initiator_tag)
 
469
        if getattr(self, "enabled", False):
 
470
            self.disable_initiator_tag = (gobject.timeout_add
 
471
                                          (_timedelta_to_milliseconds
 
472
                                           (timeout), self.disable))
 
473
            self.expires = datetime.datetime.utcnow() + timeout
472
474
    
473
475
    def need_approval(self):
474
476
        self.last_approval_request = datetime.datetime.utcnow()