Fix errors when accessing floating IP API methods

Commit 520005b13d which recently added
microversion support did not update floating IP code to account for the
extra parameter passed to all API methods. This resulted in errors like:

    File "/opt/stack/blazar/blazar/api/v1/utils.py", line 90, in handler
    return func(flask.request, **kwargs)
    TypeError: floatingips_list() takes no arguments (1 given)

Change-Id: I6820b56d0389ec285789ba38a8f82eac93595afc
This commit is contained in:
Pierre Riteau 2019-09-16 18:55:49 +02:00
parent d4c6ecf885
commit 0a775020bc

View File

@ -32,27 +32,27 @@ _api = utils.LazyProxy(service.API)
# Floatingips operations # Floatingips operations
@rest.get('') @rest.get('')
def floatingips_list(): def floatingips_list(req):
"""List all existing floatingips.""" """List all existing floatingips."""
return api_utils.render(floatingips=_api.get_floatingips()) return api_utils.render(floatingips=_api.get_floatingips())
@rest.post('') @rest.post('')
def floatingips_create(data): def floatingips_create(req, data):
"""Create new floatingip.""" """Create new floatingip."""
return api_utils.render(floatingip=_api.create_floatingip(data)) return api_utils.render(floatingip=_api.create_floatingip(data))
@rest.get('/<floatingip_id>') @rest.get('/<floatingip_id>')
@validation.check_exists(_api.get_floatingip, floatingip_id='floatingip_id') @validation.check_exists(_api.get_floatingip, floatingip_id='floatingip_id')
def floatingips_get(floatingip_id): def floatingips_get(req, floatingip_id):
"""Get floatingip by its ID.""" """Get floatingip by its ID."""
return api_utils.render(floatingip=_api.get_floatingip(floatingip_id)) return api_utils.render(floatingip=_api.get_floatingip(floatingip_id))
@rest.delete('/<floatingip_id>') @rest.delete('/<floatingip_id>')
@validation.check_exists(_api.get_floatingip, floatingip_id='floatingip_id') @validation.check_exists(_api.get_floatingip, floatingip_id='floatingip_id')
def floatingips_delete(floatingip_id): def floatingips_delete(req, floatingip_id):
"""Delete specified floatingip.""" """Delete specified floatingip."""
_api.delete_floatingip(floatingip_id) _api.delete_floatingip(floatingip_id)
return api_utils.render() return api_utils.render()