cs_vpc_offering: listVPCOffering API returns any matching names (#37783)

* fix listVPCOffering API method returns any matching names

* fix build_ci no-underscore-variable

* clearer variable name

* making it simpler
This commit is contained in:
David Passante 2018-03-23 14:13:41 +01:00 committed by ansibot
parent 56d0721bd9
commit 270e799cb6

View file

@ -149,7 +149,9 @@ class AnsibleCloudStackVPCOffering(AnsibleCloudStack):
vo = self.query_api('listVPCOfferings', **args)
if vo:
self.vpc_offering = vo['vpcoffering'][0]
for vpc_offer in vo['vpcoffering']:
if args['name'] == vpc_offer['name']:
self.vpc_offering = vpc_offer
return self.vpc_offering