Fix the undefined "msg" variable

Change-Id: Ic8f0f7953e1fff9d003e6f8bca89a0622c9067f7
This commit is contained in:
liusheng 2017-02-04 09:45:14 +08:00
parent acdb81876b
commit 46cff0dd2c

View File

@ -255,13 +255,12 @@ class FloatingIPController(rest.RestController):
fip = self.network_api.associate_floating_ip(
pecan.request.context, floating_address=address,
port_id=port_id, fixed_address=fixed_address)
except exception.FloatingIpNotFoundForAddress:
msg = _('floating IP not found')
except exception.FloatingIpNotFoundForAddress as e:
raise wsme.exc.ClientSideError(
msg, status_code=http_client.NOT_FOUND)
e.message, status_code=http_client.NOT_FOUND)
except exception.Forbidden as e:
raise wsme.exc.ClientSideError(
msg, status_code=http_client.FORBIDDEN)
e.message, status_code=http_client.FORBIDDEN)
except Exception as e:
msg = _('Unable to associate floating IP %(address)s to '
'fixed IP %(fixed_address)s for instance %(id)s. '