示例#1
0
文件: views.py 项目: ehazlett/horizon
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})
示例#2
0
文件: views.py 项目: katzj/horizon
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})
示例#3
0
文件: views.py 项目: termie/horizon
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
    })