mirror of https://github.com/apache/cloudstack.git
marvin_refactor: always check for complete object identity with json
Remove check which ensured single key match for the json result with the object response. This would return ipaddressResponse.ipaddress as a nested object whereas the response itself is the ipaddress Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
904a2bde0a
commit
8decacb34b
|
|
@ -113,10 +113,6 @@ def finalizeResultObj(result, responseName, responsecls):
|
|||
responsecls)
|
||||
return result
|
||||
elif responsecls is not None:
|
||||
for k, v in result.__dict__.iteritems():
|
||||
if k in responsecls.__dict__:
|
||||
return result
|
||||
|
||||
attr = result.__dict__.keys()[0]
|
||||
|
||||
value = getattr(result, attr)
|
||||
|
|
|
|||
|
|
@ -229,11 +229,9 @@ class IpAddressFactoryTest(unittest.TestCase):
|
|||
account=accnt.name,
|
||||
domainid=accnt.domainid)
|
||||
|
||||
all_ips = IpAddress.listPublic(apiclient=self.apiClient)
|
||||
firstip = all_ips[0]
|
||||
networks = Network.list(apiclient=self.apiClient,
|
||||
account = accnt.name, domainid = accnt.domainid)
|
||||
firstip.associate(apiclient=self.apiClient, networkid = networks[0].id)
|
||||
IpAddress(apiclient=self.apiClient, networkid = networks[0].id)
|
||||
|
||||
|
||||
class FirewallRuleFactoryTest(unittest.TestCase):
|
||||
|
|
@ -280,7 +278,7 @@ class FirewallRuleFactoryTest(unittest.TestCase):
|
|||
|
||||
fwrule = SshFirewallRuleFactory(
|
||||
apiclient=self.apiClient,
|
||||
ipaddressid=ipaddress.ipaddress.id
|
||||
ipaddressid=ipaddress.id
|
||||
)
|
||||
fwrule |should_not| be(None)
|
||||
fwrule |should| be_instance_of(Firewall)
|
||||
|
|
|
|||
Loading…
Reference in New Issue