mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: toaster: address Django-1.10 API deprecations
There are four main API deprecations in Django-1.10:
(a) String view arguments to url() must be replaced by
the explicit class reference
(b) New TEMPLATES stucture in settings.py consolidates
TEMPLATE_DIRS, TEMPLATE_CONTEXT_PROCESSORS,
TEMPLATE_LOADERS, TEMPLATE_STRING_IF_INVALID, and
TEMPLATE_DEBUG
(c) patterns() wrapper in url() is removed, with
urlpatterns now a simple list
(d) NoArgsCommand in commands() must be replace by
BaseCommand, and handle_noargs() changed to
handle()
Also, the Django version checker must be updated to accept
two digit sub-version numbers (e.g. "1.8" < "1.10")
[YOCTO #11684]
(Bitbake rev: e4c7a94fac7a53fc146387a57e5a09b9ec3caca0)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
c3058ec4a4
commit
d74bcbeaf2
@@ -1,4 +1,4 @@
|
||||
from django.core.management.base import NoArgsCommand, CommandError
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.db import transaction
|
||||
|
||||
from django.core.management import call_command
|
||||
@@ -18,7 +18,7 @@ def DN(path):
|
||||
return os.path.dirname(path)
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
args = ""
|
||||
help = "Verifies that the configured settings are valid and usable, or prompts the user to fix the settings."
|
||||
|
||||
@@ -152,7 +152,7 @@ class Command(NoArgsCommand):
|
||||
|
||||
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, **options):
|
||||
retval = 0
|
||||
retval += self._verify_build_environment()
|
||||
retval += self._verify_default_settings()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db import transaction
|
||||
from django.db.models import Q
|
||||
|
||||
@@ -16,7 +16,7 @@ import os
|
||||
logger = logging.getLogger("toaster")
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
args = ""
|
||||
help = "Schedules and executes build requests as possible. "\
|
||||
"Does not return (interrupt with Ctrl-C)"
|
||||
@@ -168,7 +168,7 @@ class Command(NoArgsCommand):
|
||||
except Exception as e:
|
||||
logger.warn("runbuilds: schedule exception %s" % str(e))
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, **options):
|
||||
pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
|
||||
".runbuilds.pid")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user