diff mbox

[v2,10/10] pwclient: Integrate 'checks' endpoint

Message ID 1443711154-18689-11-git-send-email-stephen.finucane@intel.com
State Superseded
Headers show

Commit Message

Stephen Finucane Oct. 1, 2015, 2:52 p.m. UTC
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
 patchwork/bin/pwclient | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox

Patch

diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient
index 8d1f476..4cccb6c 100755
--- a/patchwork/bin/pwclient
+++ b/patchwork/bin/pwclient
@@ -207,6 +207,11 @@  def action_projects(rpc):
                 project['linkname'], \
                 project['name']))
 
+def action_checks(rpc):
+    checks = rpc.check_list("", 0)
+    for check in checks:
+        print("%d (for '%s')" % (check['id'], check['patch']))
+
 def action_states(rpc):
     states = rpc.state_list("", 0)
     print("%-5s %s" % ("ID", "Name"))
@@ -466,6 +471,12 @@  def main():
         help='''List all projects'''
     )
     projects_parser.set_defaults(subcmd='projects')
+    checks_parser = subparsers.add_parser(
+        'checks',
+        add_help=False,
+        help='''Show list of patch checks'''
+    )
+    checks_parser.set_defaults(subcmd='checks')
     states_parser = subparsers.add_parser(
         'states',
         add_help=False,
@@ -680,6 +691,9 @@  def main():
     elif action.startswith('project'):
         action_projects(rpc)
 
+    elif action.startswith('check'):
+        action_checks(rpc)
+
     elif action.startswith('state'):
         action_states(rpc)