Qpid
  1. Qpid
  2. QPID-3578

qpid-queue-stats doesn't support multiple filters (despite --help saying it does)

    Details

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

      Description

      Trying to use multiple filters with qpid-queue-stats does not work due to an indentation issue in the Python code. For example:

      qpid-queue-stats -f "a.*,b.*"
      

      will only find queues matching the a.* pattern.

      The issue is that if the first pattern fails, instead of trying all additional patterns, execution stops. This is because the check to see if all matches failed is indented one level too far to the right. As a result, this check executes inside the for loop, instead of outside. The diff below fixes the issue:

      diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
      index 54f22df..562ccce 100755
      --- a/qpid/tools/src/py/qpid-queue-stats
      +++ b/qpid/tools/src/py/qpid-queue-stats
      @@ -84,8 +84,8 @@ class BrokerManager(Console):
               if x.match(name):                 
                 match = True
                 break
      -        if match == False:
      -          return
      +      if match == False:
      +        return
       
           if last == None:
             lastSample = first
      
      1. qpid-3578.diff
        0.5 kB
        Andy Goldstein

        Activity

        Andy Goldstein created issue -
        Andy Goldstein made changes -
        Field Original Value New Value
        Attachment qpid-3578.diff [ 12502020 ]
        Andy Goldstein made changes -
        Description Trying to use multiple filters with qpid-queue-stats does not work due to an indentation issue in the Python code. For example:

        qpid-queue-stats -f "a.*,b.*" will only find queues matching the a.* pattern.

        The issue is that if the first pattern fails, instead of trying all additional patterns, execution stops. This is because the check to see if all matches failed is indented one level too far to the right. As a result, this check executes inside the for loop, instead of outside. The diff below fixes the issue:

        diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
        index 54f22df..562ccce 100755
        --- a/qpid/tools/src/py/qpid-queue-stats
        +++ b/qpid/tools/src/py/qpid-queue-stats
        @@ -84,8 +84,8 @@ class BrokerManager(Console):
                 if x.match(name):
                   match = True
                   break
        - if match == False:
        - return
        + if match == False:
        + return
         
             if last == None:
               lastSample = first
        Trying to use multiple filters with qpid-queue-stats does not work due to an indentation issue in the Python code. For example:

        {{qpid-queue-stats -f "a.*,b.*"}}

        will only find queues matching the a.* pattern.

        The issue is that if the first pattern fails, instead of trying all additional patterns, execution stops. This is because the check to see if all matches failed is indented one level too far to the right. As a result, this check executes inside the for loop, instead of outside. The diff below fixes the issue:

        {{diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
        index 54f22df..562ccce 100755
        --- a/qpid/tools/src/py/qpid-queue-stats
        +++ b/qpid/tools/src/py/qpid-queue-stats
        @@ -84,8 +84,8 @@ class BrokerManager(Console):
                 if x.match(name):
                   match = True
                   break
        - if match == False:
        - return
        + if match == False:
        + return
         
             if last == None:
               lastSample = first}}
        Andy Goldstein made changes -
        Description Trying to use multiple filters with qpid-queue-stats does not work due to an indentation issue in the Python code. For example:

        {{qpid-queue-stats -f "a.*,b.*"}}

        will only find queues matching the a.* pattern.

        The issue is that if the first pattern fails, instead of trying all additional patterns, execution stops. This is because the check to see if all matches failed is indented one level too far to the right. As a result, this check executes inside the for loop, instead of outside. The diff below fixes the issue:

        {{diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
        index 54f22df..562ccce 100755
        --- a/qpid/tools/src/py/qpid-queue-stats
        +++ b/qpid/tools/src/py/qpid-queue-stats
        @@ -84,8 +84,8 @@ class BrokerManager(Console):
                 if x.match(name):
                   match = True
                   break
        - if match == False:
        - return
        + if match == False:
        + return
         
             if last == None:
               lastSample = first}}
        Trying to use multiple filters with qpid-queue-stats does not work due to an indentation issue in the Python code. For example:

        {noformat}
        qpid-queue-stats -f "a.*,b.*"
        {noformat}

        will only find queues matching the a.* pattern.

        The issue is that if the first pattern fails, instead of trying all additional patterns, execution stops. This is because the check to see if all matches failed is indented one level too far to the right. As a result, this check executes inside the for loop, instead of outside. The diff below fixes the issue:

        {noformat}
        diff --git a/qpid/tools/src/py/qpid-queue-stats b/qpid/tools/src/py/qpid-queue-stats
        index 54f22df..562ccce 100755
        --- a/qpid/tools/src/py/qpid-queue-stats
        +++ b/qpid/tools/src/py/qpid-queue-stats
        @@ -84,8 +84,8 @@ class BrokerManager(Console):
                 if x.match(name):
                   match = True
                   break
        - if match == False:
        - return
        + if match == False:
        + return
         
             if last == None:
               lastSample = first
        {noformat}
        Nuno Santos made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.14 [ 12316855 ]
        Resolution Fixed [ 1 ]
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Andy Goldstein
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development