Listing event using filter like 'start_timestamp' raises exception

Bug #1711997 reported by SU, HAO-CHEN
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-pankoclient
Fix Released
Undecided
Unassigned

Bug Description

Problems:

  Listing event using filter such as 'start_timestamp':

    $ openstack event list --filter start_timestamp='2017-08-15 00:00:00'

  raises exception:

    Operator eq is not supported. Only `ge' operator is available for field
    start_timestamp (HTTP 400) (Request-ID: ...

Examination:

  The code responsible for this should be 'utils.py'. Around line 32:

    url = "q.field=%s&q.op=eq&q.value=%s" % (k, v)

  (https://github.com/openstack/python-pankoclient/blob/master/pankoclient/utils.py#L32)

  The code sends query with operator 'eq' no matter what the field is.

  On the other hand, ceilometer client behaves correctly with commands like:

    $ ceilometer event-list -q 'start_timestamp>=2017-08-15 00:00:00'

Possible solution:

  Make this part of code that when some specific filter field is given, the
  operator in the url query would be the one that matches.

  Or we can, on the other hand, change how panko's api server behaves: when the
  field is a specific value such as 'start_timestamp', the operator given is
  ignored and the default one is forced to be used.

Other issues:

  Problems like this related to operator in the filter are somewhat troublesome,
  since the format of filter in openstack client must be: <key>=<value>. And it
  seems to me that all the clients such as ceilometer-client are going to be
  removed except openstack-client. These problems should be resolved after all.

SU, HAO-CHEN (astacksu)
description: updated
SU, HAO-CHEN (astacksu)
description: updated
Revision history for this message
SU, HAO-CHEN (astacksu) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-pankoclient (master)

Change abandoned by SU, HAO-CHEN (<email address hidden>) on branch: master
Review: https://review.openstack.org/495763
Reason: the issue has been solved by https://review.openstack.org/#/c/499435

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/panko 4.0.0

This issue was fixed in the openstack/panko 4.0.0 release.

Vadym Markov (vmarkov)
Changed in python-pankoclient:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.