diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-11-06 20:11:25 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-11-07 18:51:48 +0900 |
commit | 8e8180a600b1794a35611b3417a09eadaccabf85 (patch) | |
tree | e85f8134e223ec8e5094ee9b59e0cdb954800ec1 | |
parent | d47a4bc16d5a4aa23ce55a75bd4ef117425a5ed7 (diff) | |
download | pygerrit-8e8180a600b1794a35611b3417a09eadaccabf85.tar.gz |
Add method to run a gerrit command from the client
Change-Id: If1863c06619a11f93efc7c25c7c33c749950d6a5
-rw-r--r-- | pygerrit/client.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pygerrit/client.py b/pygerrit/client.py index a5a27c4..4095914 100644 --- a/pygerrit/client.py +++ b/pygerrit/client.py @@ -51,6 +51,12 @@ class GerritClient(object): """ Return the username, and version of Gerrit that is connected to. """ return self._ssh_client.get_remote_info() + def run_command(self, command): + """ Run the command. Return the result. """ + if not isinstance(command, basestring): + raise ValueError("command must be a string") + return self._ssh_client.run_gerrit_command(command) + def query(self, term): """ Run `gerrit query` with the given `term`. |