Raised exceptions must not be logged
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.vmware |
Fix Released
|
Medium
|
Radoslav Gerganov |
Bug Description
Fault messages from vCenter are translated to exceptions which are logged and then raised by oslo.vmware. The former is wrong -- there are many cases when the exception is expected and it must not be logged as an error. It is the client who must decide whether something is an error or not.
For example a common pattern is to catch DuplicateName/
2014-10-06 15:29:44,492 - oslo.vmware.api - ERROR - Exception which is not in the suggested list of exceptions occurred while invoking _invoke_api.
Traceback (most recent call last):
File "/Users/
result = f(*args, **kwargs)
File "/Users/
raise clazz(unicode(
DuplicateName: The name 'fira' already exists.
Cause: Server raised fault: 'The name 'fira' already exists.'
Faults: [DuplicateName]
Details: {'object': 'group-v343', 'name': 'fira'}
2014-10-06 15:29:44,492 - oslo.vmware.
Traceback (most recent call last):
File "/Users/
idle = self.f(*self.args, **self.kw)
File "/Users/
func_name)
File "/Users/
six.
File "/Users/
result = f(*args, **kwargs)
File "/Users/
raise clazz(unicode(
DuplicateName: The name 'fira' already exists.
Cause: Server raised fault: 'The name 'fira' already exists.'
Faults: [DuplicateName]
Details: {'object': 'group-v343', 'name': 'fira'}
The proper behaviour is to raise then exception without logging it in oslo.
Changed in oslo.vmware: | |
importance: | Undecided → Medium |
Changed in oslo.vmware: | |
status: | Fix Committed → Fix Released |
Fixed in https:/ /review. openstack. org/#/c/ 126287/ somehow the CI did not mark this bug appropriately