Esempio n. 1
0
def port_attach(request, network_id, port_id):
    attach_form, handled = AttachPort.maybe_handle(request, initial={
                                                   "network": network_id,
                                                   "port": port_id})

    if handled:
        return shortcuts.redirect('horizon:nova:networks:detail',
                                   network_id=network_id)

    return shortcuts.render(request,
                            'nova/ports/attach.html', {
                                'network': network_id,
                                'port': port_id,
                                'attach_form': attach_form})
Esempio n. 2
0
def port_attach(request, network_id, port_id):
    attach_form, handled = AttachPort.maybe_handle(request)

    if handled:
        return shortcuts.redirect('horizon:nova:networks:detail',
                                   network_id=network_id)

    # Get all avaliable vifs
    vifs = _get_available_vifs(request)

    return shortcuts.render(request,
                            'nova/ports/attach.html', {
                                'network': network_id,
                                'port': port_id,
                                'attach_form': attach_form,
                                'vifs': vifs})
Esempio n. 3
0
def port_attach(request, network_id, port_id):
    attach_form, handled = AttachPort.maybe_handle(request,
                                                   initial={
                                                       "network": network_id,
                                                       "port": port_id
                                                   })

    if handled:
        return shortcuts.redirect('horizon:nova:networks:detail',
                                  network_id=network_id)

    return shortcuts.render(request, 'nova/ports/attach.html', {
        'network': network_id,
        'port': port_id,
        'attach_form': attach_form
    })