addition to the existing 'pyang' checker. Added modal overlay displays showing the yang check results every place the yin/yang symbol is shown (red or green) to indicate the presencee and result of yang checks. Added a Yang Validation: line in the document meta-information section on the document's page in the datatracker. Added the result of the xym extaction to the yang check results, to make extration failures visible. Added the version of the used xym, pyang, and yanglint commands to the check results. Added an action to move successfully extracted and validated modules to the module library directories immediately on submission. Added the xym and pyang repositories as svn:external components, rather than listing them in requirements.txt, as there has been delays of many months between essential features in the repositories, and an actual release. We may get occasional buildbot failures if broken code is pulled in from the repository, but better that than the functionality failure of severely outdated componets. Added a new management command to re-run yang validation for active drafts for which yang modules were found at submission time, in order to pick up imported models which may have arrived in the model libraries after the draft's submission. Run daily from bin/daily. Added a table to hold version information for external commands. The yang checker output should include the version information of the used checkers, but seems unnecessary to run each command with its --version switch every time we check a module... Added a new management command to collect version information for external commands on demand. To be run daily from bin/daily. Added tests to verify that xym, pyang and yanglint information is available on the submission confirmation page, and updated the yang module contained in the test document to validate under both pyang and yanglint. Updated admin.py and resource.py files as needed. - Legacy-Id: 13630
55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
#!/usr/bin/python
|
|
|
|
# simple script for exporting name related base data for the tests
|
|
|
|
# boiler plate
|
|
import os, sys
|
|
import django
|
|
|
|
basedir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../..'))
|
|
sys.path.insert(0, basedir)
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings")
|
|
|
|
django.setup()
|
|
|
|
# script
|
|
from django.core.serializers import serialize
|
|
|
|
def output(name, seq):
|
|
try:
|
|
f = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "fixtures/%s.json" % name), 'w')
|
|
f.write(serialize("json", seq, indent=1))
|
|
f.close()
|
|
except:
|
|
from django.db import connection
|
|
from pprint import pprint
|
|
pprint(connection.queries)
|
|
raise
|
|
|
|
# pick all name models directly out of the module
|
|
objects = []
|
|
|
|
import inspect
|
|
import ietf.name.models
|
|
for n in dir(ietf.name.models):
|
|
symbol = getattr(ietf.name.models, n)
|
|
if inspect.isclass(symbol) and issubclass(symbol, ietf.name.models.NameModel):
|
|
if not symbol._meta.abstract:
|
|
objects.extend(symbol.objects.all())
|
|
|
|
|
|
import ietf.doc.models # also pick some other name-like types while we're at it
|
|
objects += ietf.doc.models.StateType.objects.all()
|
|
objects += ietf.doc.models.State.objects.all()
|
|
objects += ietf.doc.models.BallotType.objects.all()
|
|
|
|
import ietf.mailtrigger.models
|
|
objects += ietf.mailtrigger.models.Recipient.objects.all()
|
|
objects += ietf.mailtrigger.models.MailTrigger.objects.all()
|
|
|
|
import ietf.utils.models
|
|
objects += ietf.utils.models.VersionInfo.objects.all()
|
|
|
|
output("names", objects)
|
|
|