CLOUDSTACK-7866: Passing type value to list_hosts method so as to avoid listing SSVM and CPVM

Correcting hostid attribute

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
Gaurav Aradhye 2014-11-10 11:58:18 +05:30 committed by SrikanteswaraRao Talluri
parent 709bf074de
commit b00f144c20
1 changed files with 16 additions and 6 deletions

View File

@ -19,11 +19,20 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.cloudstackAPI import (migrateVirtualMachine,
prepareHostForMaintenance,
cancelHostMaintenance)
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import (Account,
VirtualMachine,
ServiceOffering)
from marvin.lib.common import (get_zone,
get_domain,
get_template,
list_hosts,
list_virtual_machines,
list_service_offering)
import time
@ -490,6 +499,7 @@ class TestHostHighAvailability(cloudstackTestCase):
#Find out Non-Suitable host for VM migration
list_hosts_response = list_hosts(
self.apiclient,
type="Routing"
)
self.assertEqual(
isinstance(list_hosts_response, list),
@ -505,7 +515,7 @@ class TestHostHighAvailability(cloudstackTestCase):
notSuitableHost = None
for host in list_hosts_response:
if not host.suitableformigration and host.hostid != vm.hostid:
if not host.suitableformigration and host.id != vm.hostid:
notSuitableHost = host
break