Commit 043690d9 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams
Browse files

Remove references to lava_dispatcher v1

Removing v1 in lava-dispatcher project will be easier.

Change-Id: Ie283a1c415d8fe0a465d61164d03a30e383575ec
parent f3dc1987
......@@ -12,9 +12,6 @@ from django.core.files.base import ContentFile
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection, transaction, IntegrityError
from lava_server.settings.getsettings import Settings
from linaro_dashboard_bundle.errors import DocumentFormatError
from linaro_dashboard_bundle.evolution import DocumentEvolution
from linaro_dashboard_bundle.io import DocumentIO
from json_schema_validator.extensions import datetime_extension, timedelta_extension
......
......@@ -56,7 +56,6 @@ from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django_restricted_resource.models import RestrictedResource
from linaro_dashboard_bundle.io import DocumentIO
from dashboard_app.helpers import BundleDeserializer
from dashboard_app.managers import BundleManager, TestRunDenormalizationManager
......
......@@ -11,7 +11,6 @@ from lava_scheduler_app.models import (
Device,
DeviceType,
DeviceStateTransition,
is_deprecated_json,
JSONDataError,
DevicesUnavailableException,
TestJob,
......@@ -75,10 +74,6 @@ class SchedulerAPI(ExposedAPI):
If the job is a multinode job, this function returns the list of created
job IDs.
"""
# Reject v1 jobs
if is_deprecated_json(job_data):
raise xmlrpclib.Fault(400, "v1 jobs cannot be submitted to this instance")
self._authenticate()
if not self.user.has_perm('lava_scheduler_app.add_testjob'):
raise xmlrpclib.Fault(
......
......@@ -75,7 +75,7 @@ class Migration(migrations.Migration):
name='DeviceType',
fields=[
('name', models.SlugField(serialize=False, primary_key=True)),
('health_check_job', models.TextField(default=None, null=True, blank=True, validators=[lava_scheduler_app.models.validate_job_json])),
('health_check_job', models.TextField(default=None, null=True, blank=True)),
('display', models.BooleanField(default=True, help_text=b"Should this be displayed in the GUI or not. This can be useful if you are removing all devices of this type but don't want to loose the test results generated by the devices.")),
('owners_only', models.BooleanField(default=False, help_text=b'Hide this device type for all users except owners of devices of this type.')),
],
......
......@@ -52,7 +52,6 @@ from lava_scheduler_app.schema import (
SubmissionException
)
from lava_dispatcher.job import validate_job_data
from lava_scheduler_app import utils
from linaro_django_xmlrpc.models import AuthToken
from lava_scheduler_app.schema import validate_device
......@@ -105,22 +104,7 @@ class Tag(models.Model):
return self.name.lower()
def is_deprecated_json(data):
""" Deprecated """
deprecated_json = True
try:
ob = simplejson.loads(data)
# calls deprecated lava_dispatcher code
validate_job_data(ob)
except (AttributeError, simplejson.JSONDecodeError, ValueError):
deprecated_json = False
return deprecated_json
def validate_job(data):
if is_deprecated_json(data):
raise SubmissionException("v1 jobs cannot be submitted to this instance")
try:
# only try YAML if this is not JSON
# YAML can parse JSON as YAML, JSON cannot parse YAML at all
......@@ -191,15 +175,6 @@ def validate_yaml(yaml_data):
raise SubmissionException(e)
def validate_job_json(data):
""" Deprecated """
try:
ob = simplejson.loads(data)
validate_job_data(ob)
except ValueError as e:
raise ValidationError(e)
class Architecture(models.Model):
name = models.CharField(
primary_key=True,
......
......@@ -16,8 +16,6 @@ from twisted.internet.threads import deferToThread # pylint: disable=unused-imp
from zope.interface import implements
import lava_dispatcher.config as dispatcher_config
from lava_scheduler_app.models import (
Device,
TestJob,
......@@ -47,7 +45,7 @@ except ImportError:
def get_configured_devices():
""" Deprecated """
return dispatcher_config.list_devices()
return []
def get_temporary_devices(devices):
......
......@@ -23,7 +23,6 @@ from django.core.management.base import BaseCommand
from lava_scheduler_app.models import (
Device,
DeviceType,
is_deprecated_json
)
import errno
......@@ -77,11 +76,6 @@ health check will be used for each variant."""
dt_skipped.append((dt.name, False))
continue
# Check that the health-check is a v2 job
if is_deprecated_json(dt.health_check_job):
dt_skipped.append((dt.name, True))
continue
# Dump to the filesystem
self.stdout.write("* %s" % dt.name)
filename = os.path.join(health_dir, dt.name + '.yaml')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment