Ejemplo n.º 1
0
 def handle(self, request, data):
     try:
         LOG.info('Releasing Floating IP "%s"' % data['floating_ip_id'])
         api.tenant_floating_ip_release(request, data['floating_ip_id'])
         messages.info(request, _('Successfully released Floating IP: %s')
                                 % data['floating_ip_id'])
     except novaclient_exceptions.ClientException, e:
         LOG.exception("ClientException in ReleaseFloatingIp")
         messages.error(request, _('Error releasing Floating IP '
                                   'from tenant: %s') % e.message)
Ejemplo n.º 2
0
    def test_tenant_floating_ip_release(self):
        novaclient = self.stub_novaclient()

        novaclient.floating_ips = self.mox.CreateMockAnything()
        novaclient.floating_ips.delete(1).AndReturn(self.floating_ip)
        self.mox.ReplayAll()

        floating_ip = api.tenant_floating_ip_release(self.request, 1)

        self.assertIsInstance(floating_ip, api.FloatingIp)
        self.mox.VerifyAll()