]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
When checking for expired licenses in the HA main loop, the License_check.check_expir...
authorDavid Scott <dave.scott@eu.citrix.com>
Wed, 26 Jan 2011 17:39:06 +0000 (17:39 +0000)
committerDavid Scott <dave.scott@eu.citrix.com>
Wed, 26 Jan 2011 17:39:06 +0000 (17:39 +0000)
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
ocaml/xapi/xapi_ha.ml

index fae9aa0daba8281970856f6c65db4e7420dedbdb..26469b62a005d1c1210359e25ad4cea383df8b42 100644 (file)
@@ -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