From 2866266a5448b7c49ca8988f82f22b25192e6e16 Mon Sep 17 00:00:00 2001 From: "sh.huang" Date: Tue, 17 Jun 2014 08:37:36 +0800 Subject: [PATCH] Transform sample_cnt type to int Duration is seconds from current time, and sample_cnt on the basis of duration. So sample_cnt always not a int, but we need sample_cnt as a int type. Closes-Bug:#1330330 Change-Id: I89e1768523384e24c3a0b8b76f4fa04a123248f9 --- ceilometer/compute/virt/vmware/vsphere_operations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceilometer/compute/virt/vmware/vsphere_operations.py b/ceilometer/compute/virt/vmware/vsphere_operations.py index ef9d78605..77f00adbe 100644 --- a/ceilometer/compute/virt/vmware/vsphere_operations.py +++ b/ceilometer/compute/virt/vmware/vsphere_operations.py @@ -204,8 +204,8 @@ class VsphereOperations(object): query_spec.metricId = [metric_id] query_spec.intervalId = VC_REAL_TIME_SAMPLING_INTERVAL # We query all samples which are applicable over the specified duration - samples_cnt = (duration / VC_REAL_TIME_SAMPLING_INTERVAL if duration - else 1) + samples_cnt = (int(duration / VC_REAL_TIME_SAMPLING_INTERVAL) + if duration else 1) query_spec.maxSample = samples_cnt perf_manager = session.vim.service_content.perfManager