Incorporated review comments provided in PR#183

This commit is contained in:
sanjeev 2015-04-22 15:14:52 +05:30
parent 0bae300fa2
commit 5b7527e2da

View File

@ -417,12 +417,18 @@ class TestBasicOperations(cloudstackTestCase):
None, None,
"Removing IP from nic didn't release the ip address from user_ip_address table" "Removing IP from nic didn't release the ip address from user_ip_address table"
) )
ipaddress_2 = NIC.addIp( else:
self.apiclient, qresultset = self.dbclient.execute(
id=virtual_machine.nic[0].id, "select id from nic_secondary_ips where ip4_address = '%s';"
ipaddress=ipaddress_1.ipaddress % str(ipaddress_1.ipaddress))
) if len(qresultset):
NIC.removeIp(self.apiclient, ipaddressid=ipaddress_2.id) self.fail("Failed to release the secondary ip from the nic")
ipaddress_2 = NIC.addIp(
self.apiclient,
id=virtual_machine.nic[0].id,
ipaddress=ipaddress_1.ipaddress
)
NIC.removeIp(self.apiclient, ipaddressid=ipaddress_2.id)
try: try:
NIC.removeIp( NIC.removeIp(
self.apiclient, self.apiclient,