From dafa5e95bd651e5ba2232a3d51d64aa6da97f825 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Wed, 16 Dec 2015 13:35:14 +0800 Subject: [PATCH] Fix DeprecationWarning when call method delta_seconds We deprecated method total_seconds in 3.1, but method delta_seconds still use it, this leads DeprecationWarnings in Nova which uses method timeutils.delta_seconds. So don't call total_seconds in method delta_seconds. Change-Id: Iad3aca09f2b0c7abce8046931c4ecbc59a09e4c0 --- oslo_utils/timeutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_utils/timeutils.py b/oslo_utils/timeutils.py index 52e99b1d..a7d87533 100644 --- a/oslo_utils/timeutils.py +++ b/oslo_utils/timeutils.py @@ -295,7 +295,7 @@ def delta_seconds(before, after): datetime objects (as a float, to microsecond resolution). """ delta = after - before - return total_seconds(delta) + return delta.total_seconds() @removals.remove(