Esempio n. 1
0
def create(request):
    form, handled = CreateKeypair.maybe_handle(request)
    if handled:
        return handled

    return shortcuts.render(request, 'nova/keypairs/create.html',
                            {'create_form': form})
Esempio n. 2
0
def create(request):
    form, handled = CreateKeypair.maybe_handle(request)
    if handled:
        return handled

    return shortcuts.render(request,
                            'nova/keypairs/create.html', {
                                'create_form': form})
Esempio n. 3
0
def create(request):
    form, handled = CreateKeypair.maybe_handle(request)
    if handled:
        return handled

    context = {'form': form}

    if request.is_ajax():
        template = 'nova/keypairs/_create.html'
        context['hide'] = True
    else:
        template = 'nova/keypairs/create.html'

    return shortcuts.render(request, template, context)
Esempio n. 4
0
def create(request):
    form, handled = CreateKeypair.maybe_handle(request)
    if handled:
        return handled

    context = {'form': form}

    if request.is_ajax():
        template = 'nova/keypairs/_create.html'
        context['hide'] = True
    else:
        template = 'nova/keypairs/create.html'

    return shortcuts.render(request, template, context)
Esempio n. 5
0
def index(request):
    delete_form, handled = DeleteKeypair.maybe_handle(request)

    if handled:
        return handled

    create_form = CreateKeypair()
    import_form = ImportKeypair()

    try:
        keypairs = api.keypair_list(request)
    except novaclient_exceptions.ClientException, e:
        keypairs = []
        LOG.exception("ClientException in keypair index")
        messages.error(request, _('Error fetching keypairs: %s') % e.message)