Qpid
  1. Qpid
  2. QPID-3737

Patch to make qpid-stat -L option work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.12
    • Fix Version/s: 0.15
    • Component/s: Python Tools
    • Labels:

      Description

      Current behaviour:

      qpid -qIS queue         // Shows up to 50 queues.
      qpid -qIS queue -L 0    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 1    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 10   // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 100  // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L blah // Shows as many queues as possible (ie no limit).
      

      This happens because:

      1. the default limit is 50, and
      2. the limit argument is read as a string, but compared to an int in the Sorter constructor - a comparison that always fails.

      Behaviour after the near-trivial attached patch:

      qpid -qIS queue         // Shows up to 50 queues.
      qpid -qIS queue -L 0    // Shows as many queues as possible (ie no limit).
      qpid -qIS queue -L 1    // Shows up to 1 queue.
      qpid -qIS queue -L 10   // Shows up to 10 queues.
      qpid -qIS queue -L 100  // Shows up to 100 queues.
      qpid -qIS queue -L blah // qpid-stat: error: option -L: invalid integer value: 'foo'
      

      I'll attach the patch, but's for the impatient

      Index: qpid-stat
      ===================================================================
      --- qpid-stat   (revision 1229483)
      +++ qpid-stat   (working copy)
      @@ -70,7 +70,7 @@
                         help="Sort by column name")
           group2.add_option("-I", "--increasing", action="store_true", default=False,
                         help="Sort by increasing value (default = decreasing)")
      -    group2.add_option("-L", "--limit", default=50, metavar="<n>",
      +    group2.add_option("-L", "--limit", type="int", default=50, metavar="<n>",
                         help="Limit output to n rows")
           group2.add_option("-C", "--cluster", action="store_true", default=False,
                         help="Display per-broker cluster detail.")
      
      1. qpid-stat.diff
        0.7 kB
        Paul Colby

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        6h 47m 1 Ted Ross 10/Jan/12 15:13
        Resolved Resolved Closed Closed
        128d 10h 33m 1 Paul Colby 18/May/12 02:47
        Paul Colby made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Paul Colby added a comment -

        Confirmed fixed in 0.16 release.

        Show
        Paul Colby added a comment - Confirmed fixed in 0.16 release.
        Ted Ross made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.15 [ 12319043 ]
        Resolution Fixed [ 1 ]
        Ted Ross made changes -
        Assignee Ted Ross [ tedross ]
        Paul Colby made changes -
        Field Original Value New Value
        Attachment qpid-stat.diff [ 12510018 ]
        Hide
        Paul Colby added a comment -

        incredibly simply patch to make -L work.

        Show
        Paul Colby added a comment - incredibly simply patch to make -L work.
        Paul Colby created issue -

          People

          • Assignee:
            Ted Ross
            Reporter:
            Paul Colby
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development