fix get the name servers for a zone not validate zone_id

now the api of get /v2/zones/{zone_id}/nameservers not validate zone_id,
if set zone_id contain spaces, will trigger DBError and return 500.

Change-Id: Ia3e07c42dc548207aa7ff9efcc35a215c9660e54
(cherry picked from commit 0ba52bfb62)
This commit is contained in:
zhouhenglc 2019-09-20 14:46:36 +08:00 committed by ZhouHeng
parent 3382867b38
commit 357a41c428
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
import pecan
from oslo_log import log as logging
from designate import utils
from designate.api.v2.controllers import rest
from designate.objects.adapters import DesignateAdapter
@ -25,6 +26,7 @@ LOG = logging.getLogger(__name__)
class NameServersController(rest.RestController):
@pecan.expose(template='json:', content_type='application/json')
@utils.validate_uuid("zone_id")
def get_all(self, zone_id):
"""List NameServers for Zone"""
request = pecan.request