~devcamcar/horizon/trunk

« back to all changes in this revision

Viewing changes to django-nova-syspanel/src/django_nova_syspanel/views/security.py

  • Committer: Tarmac
  • Author(s): Todd Willey
  • Date: 2011-05-02 18:33:29 UTC
  • mfrom: (41.1.1 trunk)
  • Revision ID: tarmac-20110502183329-zw8wfyznqurmid9l
Remove default "admin"/"admin" user/project credentials and replace with what is configured in settings.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from django import template
 
2
from django.conf import settings
2
3
from django.contrib import messages
3
4
from django.contrib.auth.decorators import login_required
4
5
from django.shortcuts import redirect, render_to_response
23
24
        form = DisableProject(request.POST)
24
25
        if form.is_valid():
25
26
            name = form.cleaned_data['project_name']
26
 
            conn = nova.connection_for(nova.access, name)
 
27
            conn = nova.connection_for(settings.NOVA_ADMIN_USER, name)
27
28
            vpn = [x for x in nova.get_vpns() if x.project_id == name]
28
29
            if vpn:
29
30
                # NOTE(todd): Check, because it could already be shut-off
89
90
def disable_vpn(request):
90
91
    if request.method == "POST":
91
92
        nova = get_nova_admin_connection()
92
 
        conn = nova.connection_for("admin", "admin")
 
93
        conn = nova.connection_for(settings.NOVA_ADMIN_USER,
 
94
                                   settings.NOVA_PROJECT)
93
95
        try:
94
96
            collector = []
95
97
            for vpn in nova.get_vpns():