Esempio n. 1
0
 def handle(self, request, data):
     try:
         LOG.info('Detaching port %s' % data['port'])
         api.quantum_detach_port(request, data['network'], data['port'])
     except Exception, e:
         messages.error(request,
                        'Unable to detach port %s: %s' %
                        (data['port'], e.message,))
Esempio n. 2
0
 def handle(self, request, data):
     try:
         LOG.info('Detaching port %s' % data['port'])
         api.quantum_detach_port(request, data['network'], data['port'])
     except Exception, e:
         messages.error(request,
             _('Unable to detach port %(port)s: %(message)s') %
             {"port": data['port'], "message": e.message})
Esempio n. 3
0
 def handle(self, request, data):
     try:
         LOG.info('Detaching port %s' % data['port'])
         api.quantum_detach_port(request, data['network'], data['port'])
     except Exception, e:
         messages.error(request,
                        'Unable to detach port %s: %s' %
                        (data['port'], e.message,))
Esempio n. 4
0
    def test_port_detach(self):
        self.mox.StubOutWithMock(api, "quantum_detach_port")
        api.quantum_detach_port(IsA(http.HttpRequest), "n1", "p1").AndReturn(True)

        formData = {"port": "p1", "network": "n1", "method": "DetachPort"}

        self.mox.StubOutWithMock(messages, "success")
        messages.success(IgnoreArg(), IsA(str))

        res = self.client.post(reverse("dash_networks_detail", args=[self.request.user.tenant_id, "n1"]), formData)
Esempio n. 5
0
 def handle(self, request, data):
     try:
         LOG.info('Detaching port %s' % data['port'])
         api.quantum_detach_port(request, data['network'], data['port'])
     except Exception, e:
         messages.error(
             request,
             _('Unable to detach port %(port)s: %(message)s') % {
                 "port": data['port'],
                 "message": e.message
             })
    def test_port_detach(self):
        self.mox.StubOutWithMock(api, "quantum_detach_port")
        api.quantum_detach_port(IsA(http.HttpRequest), 'n1',
                                'p1').AndReturn(True)

        formData = {'port': 'p1', 'network': 'n1', 'method': 'DetachPort'}

        self.mox.StubOutWithMock(messages, 'success')
        messages.success(IgnoreArg(), IsA(str))

        res = self.client.post(
            reverse('dash_networks_detail',
                    args=[self.request.user.tenant, "n1"]), formData)
    def test_port_detach(self):
        self.mox.StubOutWithMock(api, "quantum_detach_port")
        api.quantum_detach_port(IsA(http.HttpRequest),
                                'n1', 'p1').AndReturn(True)

        formData = {'port': 'p1',
                    'network': 'n1',
                    'method': 'DetachPort'}

        self.mox.StubOutWithMock(messages, 'success')
        messages.success(IgnoreArg(), IsA(str))

        res = self.client.post(reverse('dash_networks_detail',
                               args=[self.request.user.tenant, "n1"]),
                               formData)
Esempio n. 8
0
 def handle(self, request, data):
     try:
         LOG.info("Detaching port %s" % data["port"])
         api.quantum_detach_port(request, data["network"], data["port"])
     except Exception, e:
         messages.error(request, "Unable to detach port %s: %s" % (data["port"], e.message))