WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] CA-35038: Grace period should not be rounded to days

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] CA-35038: Grace period should not be rounded to days
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Tue, 17 Nov 2009 14:58:29 +0000
Delivery-date: Tue, 17 Nov 2009 06:58:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
CA-35038: Grace period should not be rounded to days

Reverted the behaviour that rounds the expiry dates for grace licenses to day 
boundaries (expiry on midnight).

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r dc7320fcfd37 ocaml/license/v6client.ml
--- a/ocaml/license/v6client.ml Thu Nov 12 15:31:27 2009 +0000
+++ b/ocaml/license/v6client.ml Tue Nov 17 14:47:38 2009 +0000
@@ -35,11 +35,6 @@
 
 (* conversion to v6 edition codes *)
 let editions = ["enterprise", "ENT"; "platinum", "PLT"]
-
-(* round a date, given by Unix.time, to days *)
-let round_to_days d =
-       let days = (int_of_float d) / (24 * 3600) in
-       (float_of_int days) *. 24. *. 3600.
        
 (* reset to not-licensed state *)
 let reset_state () =
@@ -112,7 +107,7 @@
                                (* set expiry date *)
                                let now = Unix.time () in
                                if days_to_expire > -1 then
-                                       expires := (round_to_days now +. 
(float_of_int (days_to_expire * 24 * 3600)))
+                                       expires := now +. (float_of_int 
(days_to_expire * 24 * 3600))
                                else
                                        expires := never;
                                (* check fist point *)

Attachment: v6-no-rounding
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] CA-35038: Grace period should not be rounded to days, Rob Hoes <=