[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.