Project

General

Profile

Bug #36701

calling Device.is_valid repeatedly duplicates entries in Device._rejected_reasons

Added by Jan Fajerski 10 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/05/2018
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

Device.is_valid only ever adds to _rejected_reason. Two fixes are possible:

- is_valid resets _rejected_reasons on every call
- Don't expose is_valid with the @property decorator. Instead expose the is_valid as a true property and set it on object creation once.

I'd prefer option 2 since we don't expect that property to change once a Device instance is created.

I have the fix ready, unless option 1 is preferable...

Also available in: Atom PDF