Exemplo n.º 1
0
 def handle(self, request, data):
     try:
         LOG.info("Creating %s ports on network %s" % (data["ports_num"], data["network"]))
         for i in range(0, data["ports_num"]):
             api.quantum_create_port(request, data["network"])
     except Exception, e:
         messages.error(request, "Unable to create ports on network %s: %s" % (data["network"], e.message))
Exemplo n.º 2
0
 def handle(self, request, data):
     try:
         LOG.info('Creating %s ports on network %s' %
                  (data['ports_num'], data['network']))
         for i in range(0, data['ports_num']):
             api.quantum_create_port(request, data['network'])
     except Exception, e:
         messages.error(request,
                        'Unable to create ports on network %s: %s' %
                        (data['network'], e.message))
Exemplo n.º 3
0
 def handle(self, request, data):
     try:
         LOG.info('Creating %s ports on network %s' %
                  (data['ports_num'], data['network']))
         for i in range(0, data['ports_num']):
             api.quantum_create_port(request, data['network'])
     except Exception, e:
         messages.error(request,
             _('Unable to create ports on network %(network)s: %(msg)s') %
             {"network": data['network'], "msg": e.message})
Exemplo n.º 4
0
    def test_port_create(self):
        self.mox.StubOutWithMock(api, "quantum_create_port")
        api.quantum_create_port(IsA(http.HttpRequest), "n1").AndReturn(True)

        formData = {"ports_num": 1, "network": "n1", "method": "CreatePort"}

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

        res = self.client.post(reverse("dash_ports_create", args=[self.request.user.tenant_id, "n1"]), formData)

        self.assertRedirectsNoFollow(res, reverse("dash_networks_detail", args=[self.request.user.tenant_id, "n1"]))
Exemplo n.º 5
0
 def handle(self, request, data):
     try:
         LOG.info('Creating %s ports on network %s' %
                  (data['ports_num'], data['network']))
         for i in range(0, data['ports_num']):
             api.quantum_create_port(request, data['network'])
     except Exception, e:
         messages.error(
             request,
             _('Unable to create ports on network %(network)s: %(msg)s') % {
                 "network": data['network'],
                 "msg": e.message
             })
Exemplo n.º 6
0
    def test_port_create(self):
        self.mox.StubOutWithMock(api, "quantum_create_port")
        api.quantum_create_port(IsA(http.HttpRequest), 'n1').AndReturn(True)

        formData = {'ports_num': 1, 'network': 'n1', 'method': 'CreatePort'}

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

        res = self.client.post(
            reverse('dash_ports_create', args=[self.request.user.tenant,
                                               "n1"]), formData)

        self.assertRedirectsNoFollow(
            res,
            reverse('dash_networks_detail',
                    args=[self.request.user.tenant, "n1"]))
    def test_port_create(self):
        self.mox.StubOutWithMock(api, "quantum_create_port")
        api.quantum_create_port(IsA(http.HttpRequest), 'n1').AndReturn(True)

        formData = {'ports_num': 1,
                    'network': 'n1',
                    'method': 'CreatePort'}

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

        res = self.client.post(reverse('dash_ports_create',
                               args=[self.request.user.tenant, "n1"]),
                               formData)

        self.assertRedirectsNoFollow(res, reverse('dash_networks_detail',
                                          args=[self.request.user.tenant,
                                          "n1"]))