remove db2 support from tree
This removes db2 support from tree completely. This is an oddball non open database that made doing live data migrations difficult. It is used by 0% of users in the OpenStack User Survey. Supporting commercial software that doesn't have users at the cost of delivering features and fixes to our community is the wrong tradeoff. This corrects that. It rewrites migrations, which we typically don't ever do, but it is better if newton fresh environments fail early in db creation instead of very deep in the data migration process. Change-Id: Ifeb9929e4515e3483eb65d371126afd7672b92a4
This commit is contained in:
@@ -40,9 +40,6 @@ Run like:
|
||||
./tools/db/schema_diff.py postgresql://localhost \
|
||||
master:latest my_branch:82
|
||||
|
||||
DB2:
|
||||
./tools/db/schema_diff.py ibm_db_sa://localhost \
|
||||
master:latest my_branch:82
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
@@ -121,28 +118,6 @@ class Postgresql(object):
|
||||
shell=True)
|
||||
|
||||
|
||||
class Ibm_db_sa(object):
|
||||
|
||||
@classmethod
|
||||
def db2cmd(cls, cmd):
|
||||
"""Wraps a command to be run under the DB2 instance user."""
|
||||
subprocess.check_call('su - $(db2ilist) -c "%s"' % cmd, shell=True)
|
||||
|
||||
def create(self, name):
|
||||
self.db2cmd('db2 \'create database %s\'' % name)
|
||||
|
||||
def drop(self, name):
|
||||
self.db2cmd('db2 \'drop database %s\'' % name)
|
||||
|
||||
def dump(self, name, dump_filename):
|
||||
self.db2cmd('db2look -d %(name)s -e -o %(dump_filename)s' %
|
||||
{'name': name, 'dump_filename': dump_filename})
|
||||
# The output file gets dumped to the db2 instance user's home directory
|
||||
# so we have to copy it back to our current working directory.
|
||||
subprocess.check_call('cp /home/$(db2ilist)/%s ./' % dump_filename,
|
||||
shell=True)
|
||||
|
||||
|
||||
def _get_db_driver_class(db_url):
|
||||
try:
|
||||
return globals()[db_url.split('://')[0].capitalize()]
|
||||
|
||||
Reference in New Issue
Block a user