From 7f5e75188ad4527e3c3425a155dfed0847a389dd Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 19 Oct 2015 03:36:42 +0000 Subject: Amputate old SQL code out of rpkid with a fire axe, replacing it with Django ORM. Duct tape and bailing wire everywhere, much clean-up left to do, but basic "make yamltest" suite runs. Much of the clean-up isn't worth doing until after revamping the I/O system, as it'll all change again at that point anyway. svn path=/branches/tk705/; revision=6127 --- ca/tests/sql-cleaner.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'ca/tests/sql-cleaner.py') diff --git a/ca/tests/sql-cleaner.py b/ca/tests/sql-cleaner.py index 369a68ea..828100a4 100644 --- a/ca/tests/sql-cleaner.py +++ b/ca/tests/sql-cleaner.py @@ -19,7 +19,6 @@ """ import rpki.config -import rpki.sql_schemas from rpki.mysql_import import MySQLdb cfg = rpki.config.parser(section = "yamltest", allow_missing = True) @@ -29,15 +28,6 @@ for name in ("rpkid", "irdbd", "pubd"): username = cfg.get("%s_sql_username" % name, name[:4]) password = cfg.get("%s_sql_password" % name, "fnord") - # All of this schema creation stuff will go away once we're on Django ORM. - # For the moment, a quick kludge for testing. - schema = [] - if name == "rpkid": - for line in getattr(rpki.sql_schemas, name, "").splitlines(): - schema.extend(line.partition("--")[0].split()) - schema = " ".join(schema).strip(";").split(";") - schema = [statement.strip() for statement in schema if statement and "DROP TABLE" not in statement] - db = MySQLdb.connect(user = username, passwd = password) cur = db.cursor() @@ -57,8 +47,5 @@ for name in ("rpkid", "irdbd", "pubd"): cur.execute("DROP TABLE %s" % table) cur.execute("SET foreign_key_checks = 1") - for statement in schema: - cur.execute(statement) - cur.close() db.close() -- cgit v1.2.3