exception in ceilometer middeware when reseller_prefix is set as empty string

Bug #1835894 reported by manu on 2019-07-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceilometermiddleware
Undecided
Unassigned

Bug Description

when we set the reseller_prefix is set to empty string swift-proxy ceilometermiddleware runs into the following exception

STDERR: ERROR:ceilometermiddleware.swift:An exception occurred processing the API call: empty separator #012Traceback (most recent call last):#012 File "/usr/lib/python2.7/site-packages/ceilometermiddleware/swift.py", line 98, in wrapper#012 return fn(*args, **kwargs)#012 File "/usr/lib/python2.7/site-packages/ceilometermiddleware/swift.py", line 342, in emit_event#012 id=account.partition(self.reseller_prefix)[2] or path)#012ValueError: empty separator (txn: txc750116f2a644428b8577-005d239afb)

manu (manuvakery) wrote :

this can be fixed by adding a small check like below

if self.reseller_prefix:
   target = cadf_resource.Resource(
                typeURI='service/storage/object',
                id=account.partition(self.reseller_prefix)[2] or path)
else:
  target = cadf_resource.Resource(
                typeURI='service/storage/object',
                id=account)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers