From 80fb666fa276b78e87590bb06d3b932eeef48e0e Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Wed, 31 Oct 2012 19:38:55 +0200 Subject: [PATCH] Fixes hypervisor based image filtering on Hyper-V Fixes Bug #1073547 Nova scheduler's ImagePropertiesFilter based filtering requires the "supported_instances" stat returned by the driver's get_host_stats method. This fix implements the get_host_stats method, providing also some refactoring in the process by adding a HostOps class. Change-Id: Ia6e73eb3e8ff0be028854fe4fd6d8e305fa1d504 --- ...PITestCase.test_get_host_stats_shutil.p.gz | Bin 0 -> 290 bytes ...rVAPITestCase.test_get_host_stats_wmi.p.gz | Bin 0 -> 888 bytes nova/tests/test_hypervapi.py | 10 ++ nova/virt/hyperv/driver.py | 10 +- nova/virt/hyperv/hostops.py | 169 ++++++++++++++++++ nova/virt/hyperv/vmops.py | 107 ----------- 6 files changed, 184 insertions(+), 112 deletions(-) create mode 100644 nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz create mode 100644 nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_wmi.p.gz create mode 100644 nova/virt/hyperv/hostops.py diff --git a/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz b/nova/tests/hyperv/stubs/test_hypervapi.HyperVAPITestCase.test_get_host_stats_shutil.p.gz new file mode 100644 index 0000000000000000000000000000000000000000..805931bbb206568e75242956e028150acfb8acaf GIT binary patch literal 290 zcmV+-0p0!|iwFpaVUbV*|8!+@bYEzBaAk6KVQ^_KNO^E&a#lf5NmONXbVFftWiE7O zb97&4WprO?Z*z2Cb97;Jb6<04b#!TLE^q){kG)O(H^Oe)a6XnCLL+7)$e6~oReGhZwd(%PF3y9LyLeqUnC|s2rNmM1-ty}cpmqSTLq67^JRItb5h(12&3}>8WzCI+4%~1%MuiCEJWu0$O zjnPR~`F*V~&xhJJ`&H?)`?~Sp4rm?jP)$&lB)2DDZ2kj2OJBKr+raIc8N{=*)mh_xclNb(u>Lteh27i5kDuGcDL_(mQq+W@JYeSp z<&h}ifhiI3*Cfg#H4?bxkr2^=z?YqE4gg>vMe##U^UcNki}UN*tJ%A&kL%fb<2L7; z%gf4jE)7;Do1okI>bywXcJ|!$>F zP@y!tf3x?+uCyUB&QQL0jkW)LKC~`Ni?uC%bLi{&)m4lp!TKf*hdgf&ZD-3U z;B@{AGg-8Np+H$+LPFb^s9v}R9i+SF-gAG%Zc9Dwg!dq14!zZ$o<*I{V9 zWiNXrqAD>_B|(*ps^q9j9#u(>^4=U7YTf%H