X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=PLC%2FLeases.py;fp=PLC%2FLeases.py;h=c1b2235a1af7c37bda2146ce5d52f0d158553c0f;hp=5e99129b454187c3e72c3e6f4aed46d363106793;hb=627477ce2065f9181498bd596e11d5179537bca5;hpb=cab70ce8fccbe5c4fae1da42e09a1f3b0f9dd9be diff --git a/PLC/Leases.py b/PLC/Leases.py index 5e99129..c1b2235 100644 --- a/PLC/Leases.py +++ b/PLC/Leases.py @@ -50,18 +50,19 @@ class Lease(Row): # retrieve configured granularity granularity = self.api.config.PLC_RESERVATION_GRANULARITY # the trick for rounding up rather than down - if round_up: timestamp += (granularity-1) + if round_up: + timestamp += (granularity-1) # round down timestamp = (timestamp/granularity) * granularity # return a SQL string return Timestamp.sql_validate_utc(timestamp) # round UP - def validate_t_from(self,timestamp): - return self.validate_time (timestamp, round_up=True) + def validate_t_from(self, timestamp): + return self.validate_time(timestamp, round_up=True) # round DOWN def validate_t_until (self, timestamp): - return self.validate_time (timestamp, round_up=False) + return self.validate_time(timestamp, round_up=False) class Leases(Table): """