浏览代码

dispatcher: dispatcher.list doesn't expect setid parameter

- removed the option to retrieve it
Daniel-Constantin Mierla 8 年之前
父节点
当前提交
b2bbed9460
共有 1 个文件被更改,包括 9 次插入8 次删除
  1. 9 8
      kamcli/commands/cmd_dispatcher.py

+ 9 - 8
kamcli/commands/cmd_dispatcher.py

@@ -80,30 +80,29 @@ def dispatcher_showdb(ctx, oformat, ostyle, setid):
 
     \b
     Parameters:
-        <setid> - dispatching set id
+        [<setid>] - dispatching set id
     """
     e = create_engine(ctx.gconfig.get('db', 'rwurl'))
     if not setid:
         ctx.vlog('Showing all dispatcher records')
         res = e.execute('select * from dispatcher')
+        ioutils_dbres_print(ctx, oformat, ostyle, res)
     else:
-        ctx.vlog('Showing dispatcher records for set id')
-        res = e.execute('select * from dispatcher where setid=%d', setid)
-    ioutils_dbres_print(ctx, oformat, ostyle, res)
+        for s in setid:
+            ctx.vlog('Showing dispatcher records for set id')
+            res = e.execute('select * from dispatcher where setid=%d', setid)
+            ioutils_dbres_print(ctx, oformat, ostyle, res)
 
 
 ##
 #
 #
 @cli.command('list', short_help='Show details for dispatcher records in memory')
[email protected]('setid', nargs=-1, metavar='[<setid>]', type=int)
 @pass_context
-def dispatcher_list(ctx, setid):
+def dispatcher_list(ctx):
     """Show details for dispatcher records in memory
 
     \b
-    Parameters:
-        <setid> - dispatching set id
     """
     command_ctl(ctx, 'dispatcher.list', [ ])
 
@@ -115,6 +114,8 @@ def dispatcher_list(ctx, setid):
 @pass_context
 def dispatcher_reload(ctx):
     """Reload dispatcher records from database into memory
+
+    \b
     """
     command_ctl(ctx, 'dispatcher.reload', [ ])