summaryrefslogtreecommitdiffstats
path: root/generator.py
diff options
context:
space:
mode:
authorGuannan Ren <gren@redhat.com>2012-09-28 20:29:03 +0800
committerGuannan Ren <gren@redhat.com>2012-10-08 21:54:06 +0800
commit49873a855f0ede1388cea7ef37bf861e88950d61 (patch)
treec89cf3145815f048b3a4db98512470709b66a3a6 /generator.py
parentf0b144406d83a37e6029896a6b5ec5ee4023b39d (diff)
downloadlibvirt-python-split-49873a855f0ede1388cea7ef37bf861e88950d61.tar.gz
libvirt-python-split-49873a855f0ede1388cea7ef37bf861e88950d61.tar.xz
libvirt-python-split-49873a855f0ede1388cea7ef37bf861e88950d61.zip
python: keep consistent handling of Python integer conversion
libvirt_ulonglongUnwrap requires the integer type of python obj. But libvirt_longlongUnwrap still could handle python obj of Pyfloat_type which causes the float value to be rounded up to an integer. For example >>> dom.setSchedulerParameters({'vcpu_quota': 0.88}) 0 libvirt_longlongUnwrap treats 0.88 as a valid value 0 However >>> dom.setSchedulerParameters({'cpu_shares': 1000.22}) libvirt_ulonglongUnwrap will throw out an error "TypeError: an integer is required" The patch make this consistent.
Diffstat (limited to 'generator.py')
0 files changed, 0 insertions, 0 deletions