/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

Miscellaneous fixes prompted by lintian:

* debian/control (Conflicts): Changed to "Breaks:".
* debian/copyright: Updated format.
* debian/mandos-client.postinst: Use "set -e" instead of "#!/bin/sh -e".
* debian/mandos-client.postrm: - '' -
* debian/mandos.postinst: - '' -
* debian/mandos.prerm: Consistent magic.
* mandos: Small comment change.
* mandos-clients.conf.xml (OPTIONS/extended_timeout): Fix spelling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        SO_BINDTODEVICE = None
84
84
 
85
85
 
86
 
version = "1.4.1"
 
86
version = "1.4.0"
87
87
 
88
88
#logger = logging.getLogger('mandos')
89
89
logger = logging.Logger('mandos')
464
464
        if timeout is None:
465
465
            timeout = self.timeout
466
466
        self.last_checked_ok = datetime.datetime.utcnow()
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
 
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
474
472
    
475
473
    def need_approval(self):
476
474
        self.last_approval_request = datetime.datetime.utcnow()
893
891
        """ Modify a variable so that it's a property which announces
894
892
        its changes to DBus.
895
893
 
896
 
        transform_fun: Function that takes a value and a variant_level
897
 
                       and transforms it to a D-Bus type.
 
894
        transform_fun: Function that takes a value and transforms it
 
895
                       to a D-Bus type.
898
896
        dbus_name: D-Bus name of the variable
899
897
        type_func: Function that transform the value before sending it
900
898
                   to the D-Bus.  Default: no transform
907
905
                    type_func(getattr(self, attrname, None))
908
906
                    != type_func(value)):
909
907
                    dbus_value = transform_func(type_func(value),
910
 
                                                variant_level
911
 
                                                =variant_level)
 
908
                                                variant_level)
912
909
                    self.PropertyChanged(dbus.String(dbus_name),
913
910
                                         dbus_value)
914
911
            setattr(self, attrname, value)
1190
1187
        gobject.source_remove(self.disable_initiator_tag)
1191
1188
        self.disable_initiator_tag = None
1192
1189
        self.expires = None
1193
 
        time_to_die = _timedelta_to_milliseconds((self
1194
 
                                                  .last_checked_ok
1195
 
                                                  + self.timeout)
1196
 
                                                 - datetime.datetime
1197
 
                                                 .utcnow())
 
1190
        time_to_die = (self.
 
1191
                       _timedelta_to_milliseconds((self
 
1192
                                                   .last_checked_ok
 
1193
                                                   + self.timeout)
 
1194
                                                  - datetime.datetime
 
1195
                                                  .utcnow()))
1198
1196
        if time_to_die <= 0:
1199
1197
            # The timeout has passed
1200
1198
            self.disable()