From e484413dbde67d3dabb707750ff48232c0ba331f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 May 2019 23:17:29 +0800 Subject: [PATCH] pybind/mgr: convert str to int using "int()" on python3, integers are of unlimited size. while on python2, "long" integers have unlimited size. Fixes: https://tracker.ceph.com/issues/38627 Signed-off-by: Kefu Chai --- src/pybind/mgr/insights/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index 21da24e11fb..616fc649d69 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -307,7 +307,10 @@ class Module(MgrModule): the selftest module to manage testing scenarios related to tracking health history. """ - hours = long(hours) + try: + hours = long(hours) + except NameError: + hours = int(hours) health_util.NOW_OFFSET = datetime.timedelta(hours = hours) self.log.warning("Setting now time offset {}".format(health_util.NOW_OFFSET)) -- 2.47.3