diff options
author | Rob Austein <sra@hactrn.net> | 2011-08-12 03:34:38 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-08-12 03:34:38 +0000 |
commit | 6f3f7b7b270dee78d520c52c9c3f7e28dfff2cbe (patch) | |
tree | 5e4f6ce8ed9cab08321759e1d3287310a9a3cd53 /rpkid/tests/smoketest.py | |
parent | 4a739a155b00e582435d7906840f58282ebf8f7d (diff) |
Don't freak out over failure to drop nonexistant tables
svn path=/rpkid/tests/smoketest.py; revision=3947
Diffstat (limited to 'rpkid/tests/smoketest.py')
-rw-r--r-- | rpkid/tests/smoketest.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py index 7ee6f4af..50746170 100644 --- a/rpkid/tests/smoketest.py +++ b/rpkid/tests/smoketest.py @@ -694,13 +694,21 @@ class allocation(object): cur = db.cursor() db.autocommit(True) for sql in rpki_sql: - cur.execute(sql) + try: + cur.execute(sql) + except: + if not sql.upper().startswith("DROP TABLE"): + raise db.close() db = MySQLdb.connect(user = "irdb", db = self.irdb_db_name, passwd = irdb_db_pass) cur = db.cursor() db.autocommit(True) for sql in irdb_sql: - cur.execute(sql) + try: + cur.execute(sql) + except: + if not sql.upper().startswith("DROP TABLE"): + raise for s in [self] + self.hosts: for kid in s.kids: cur.execute("INSERT registrant (registrant_handle, registry_handle, valid_until) VALUES (%s, %s, %s)", @@ -1152,7 +1160,11 @@ def setup_publication(pubd_sql): cur = db.cursor() db.autocommit(True) for sql in pubd_sql: - cur.execute(sql) + try: + cur.execute(sql) + except: + if not sql.upper().startswith("DROP TABLE"): + raise db.close() d = { "pubd_name" : pubd_name, "pubd_port" : pubd_port, |