Fix Designate Zone ID lookup for real

When there are no 'supported_versions' defined for a client plugin,
we should not use version when calling self.client()

Also fixes similar issue in resources.

Task: 38165

Change-Id: Ifce776e8e8375f6a4399574aa71cc2f81ecc57b0
changes/66/703066/3
Rabi Mishra 3 years ago
parent a32cadd637
commit 2f63735a5c

@ -39,7 +39,7 @@ class DesignateClientPlugin(client_plugin.ClientPlugin):
return isinstance(ex, exceptions.NotFound)
def get_zone_id(self, zone_id_or_name):
client = self.client(version='2')
client = self.client()
try:
zone_obj = client.zones.get(zone_id_or_name)
return zone_obj['id']

@ -98,10 +98,6 @@ class DesignateRecordSet(resource.Resource):
entity = 'recordsets'
def client(self):
return super(DesignateRecordSet,
self).client(version=self.client_plugin().V2)
def handle_create(self):
args = dict((k, v) for k, v in six.iteritems(self.properties) if v)
args['type_'] = args.pop(self.TYPE)

@ -105,10 +105,6 @@ class DesignateZone(resource.Resource):
entity = 'zones'
def client(self):
return super(DesignateZone,
self).client(version=self.client_plugin().V2)
def validate(self):
super(DesignateZone, self).validate()

Loading…
Cancel
Save