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
This commit is contained in:
Rabi Mishra 2020-01-17 17:37:03 +05:30
parent a32cadd637
commit 2f63735a5c
3 changed files with 1 additions and 9 deletions

View File

@ -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']

View File

@ -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)

View File

@ -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()