diff --git a/accounts/templates/logout.html b/accounts/templates/logout.html index eb3b917..eb3a325 100644 --- a/accounts/templates/logout.html +++ b/accounts/templates/logout.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base_auth.html" %} {% load i18n %} {% block title %} {% trans "WebVirtCloud" %} - {% trans "Sign Out"%} @@ -14,4 +14,4 @@ -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/instances/utils.py b/instances/utils.py index 19b2111..f9f5dcf 100644 --- a/instances/utils.py +++ b/instances/utils.py @@ -196,7 +196,7 @@ def get_dhcp_mac_address(vname): def get_random_mac_address(): - mac = settings.MAC_OUI + ":%02x:%02x:%02x" % ( + mac = "52:54:00:%02x:%02x:%02x" % ( random.randint(0x00, 0xFF), random.randint(0x00, 0xFF), random.randint(0x00, 0xFF), diff --git a/templates/403.html b/templates/403.html index 6b0a7e8..4b320b4 100644 --- a/templates/403.html +++ b/templates/403.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base_auth.html" %} {% load i18n %} {% block title %}{% trans "403" %}{% endblock %} {% block content %} diff --git a/templates/404.html b/templates/404.html index dd42e10..c631d46 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base_auth.html" %} {% load i18n %} {% block title %}{% trans "404" %}{% endblock %} {% block content %} diff --git a/vrtManager/util.py b/vrtManager/util.py index 81cb3d5..ab47f32 100644 --- a/vrtManager/util.py +++ b/vrtManager/util.py @@ -6,8 +6,6 @@ import string import libvirt import lxml.etree as etree -from django.conf import UserSettingsHolder, settings - def is_kvm_available(xml): kvm_domains = get_xml_path(xml, "//domain/@type='kvm'") @@ -17,12 +15,10 @@ def is_kvm_available(xml): def randomMAC(): """Generate a random MAC address.""" # qemu MAC - mac = settings.MAC_OUI + ":%02x:%02x:%02x" % ( - random.randint(0x00, 0xFF), - random.randint(0x00, 0xFF), - random.randint(0x00, 0xFF), - ) - return mac + oui = [0x52, 0x54, 0x00] + + mac = oui + [random.randint(0x00, 0xFF), random.randint(0x00, 0xFF), random.randint(0x00, 0xFF)] + return ":".join(map(lambda x: "%02x" % x, mac)) def randomUUID(): diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index d3b9fd9..88146c1 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -15,8 +15,6 @@ SECRET_KEY = "" DEBUG = False -MAC_OUI = '52:54:10' - ALLOWED_HOSTS = ["*"] CSRF_TRUSTED_ORIGINS = ['http://localhost',]