From d56ed3b82f92f2c1e2430dd0d887c978c7767687 Mon Sep 17 00:00:00 2001 From: David Scott Date: Wed, 26 Jan 2011 17:39:06 +0000 Subject: [PATCH] When checking for expired licenses in the HA main loop, the License_check.check_expiry function returns () meaning "not expired" and raises LICENSE_EXPIRED otherwise. Signed-off-by: David Scott --- ocaml/xapi/xapi_ha.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocaml/xapi/xapi_ha.ml b/ocaml/xapi/xapi_ha.ml index fae9aa0d..26469b62 100644 --- a/ocaml/xapi/xapi_ha.ml +++ b/ocaml/xapi/xapi_ha.ml @@ -443,8 +443,10 @@ module Monitor = struct let params = Db.Host.get_license_params ~__context ~self:host in try License_check.check_expiry ~__context ~host; - true - with _ -> false (* fail safe *) in + false + with + | Api_errors.Server_error (code, []) when code = Api_errors.license_expired -> true + | _ -> false (* fail safe *) in let expired_hosts = List.filter license_has_expired all_hosts in (* Find the expired ones which are still enabled *) let enabled_but_expired = List.filter (fun self -> Db.Host.get_enabled ~__context ~self) expired_hosts in -- 2.39.5