576
576
self.checker_callback_tag = None
577
577
self.checker = None
578
578
if os.WIFEXITED(condition):
579
self.last_checker_status = os.WEXITSTATUS(condition)
579
self.last_checker_status = os.WEXITSTATUS(condition)
580
580
if self.last_checker_status == 0:
581
581
logger.info("Checker for %(name)s succeeded",
1069
1069
datetime_to_dbus, "LastApprovalRequest")
1070
1070
approved_by_default = notifychangeproperty(dbus.Boolean,
1071
1071
"ApprovedByDefault")
1072
approval_delay = notifychangeproperty(dbus.UInt16,
1072
approval_delay = notifychangeproperty(dbus.UInt64,
1073
1073
"ApprovalDelay",
1075
1075
timedelta_to_milliseconds)
1076
1076
approval_duration = notifychangeproperty(
1077
dbus.UInt16, "ApprovalDuration",
1077
dbus.UInt64, "ApprovalDuration",
1078
1078
type_func = timedelta_to_milliseconds)
1079
1079
host = notifychangeproperty(dbus.String, "Host")
1080
timeout = notifychangeproperty(dbus.UInt16, "Timeout",
1080
timeout = notifychangeproperty(dbus.UInt64, "Timeout",
1082
1082
timedelta_to_milliseconds)
1083
1083
extended_timeout = notifychangeproperty(
1084
dbus.UInt16, "ExtendedTimeout",
1084
dbus.UInt64, "ExtendedTimeout",
1085
1085
type_func = timedelta_to_milliseconds)
1086
interval = notifychangeproperty(dbus.UInt16,
1086
interval = notifychangeproperty(dbus.UInt64,
1089
1089
timedelta_to_milliseconds)
1280
1280
def Host_dbus_property(self, value=None):
1281
1281
if value is None: # get
1282
1282
return dbus.String(self.host)
1283
self.host = unicode(value)
1285
1285
# Created - property
1286
1286
@dbus_service_property(_interface, signature="s", access="read")
1380
1380
def Checker_dbus_property(self, value=None):
1381
1381
if value is None: # get
1382
1382
return dbus.String(self.checker_command)
1383
self.checker_command = value
1383
self.checker_command = unicode(value)
1385
1385
# CheckerRunning - property
1386
1386
@dbus_service_property(_interface, signature="b",
2244
2244
# enabled if its last checker was sucessful. Clients
2245
2245
# whose checker failed before we stored its state is
2246
2246
# assumed to have failed all checkers during downtime.
2247
if client["enabled"] and client["last_checked_ok"]:
2248
if ((datetime.datetime.utcnow()
2249
- client["last_checked_ok"])
2250
> client["interval"]):
2247
if client["enabled"]:
2248
if client["expires"] <= (datetime.datetime
2250
# Client has expired
2251
2251
if client["last_checker_status"] != 0:
2252
2252
client["enabled"] = False