Remove dangerous dbQuery method.

Running DB queries over an SSH connection got gerrit gsql requires a lot
of overhead to do sanely. Remove this method to avoid abuse and the need
to support it. gerritlib users should use a dbapi implementation for the
DB backing gerrit to perform DB queries directly.

Change-Id: I4f9449b5546a3714a79172c57ea6086c7707f86a
This commit is contained in:
Clark Boylan 2012-12-04 14:31:50 -08:00
parent 793098f8dc
commit fb041565da
1 changed files with 0 additions and 16 deletions

View File

@ -160,22 +160,6 @@ class Gerrit(object):
pprint.pformat(data)))
return data
def dbQuery(self, query):
cmd = 'gerrit gsql --format JSON -c "%s"' % query
out, err = self._ssh(cmd)
if not out:
return False
lines = out.strip().split('\n')
if not lines:
return False
data = map(json.loads, lines)
if not data:
return False
self.log.debug("Received %s rows from Gerrit DB query: \n%s" % (
# Subtract one for query states line.
(len(data) - 1), query))
return data
def _ssh(self, command):
client = paramiko.SSHClient()
client.load_system_host_keys()