[PATCH 3/3] lower empty backends/chain priority to -10. Ref #372

Gbp-Pq: Topic lp1864204
Gbp-Pq: Name 0003-lower-empty-backends-chain-priority-to-10.-Ref-372.patch
This commit is contained in:
Dan Streetman 2020-02-21 11:39:45 -05:00 committed by openKylinBot
parent ed1677dc05
commit 7ec55e4653
1 changed files with 4 additions and 2 deletions

View File

@ -23,9 +23,11 @@ class ChainerBackend(backend.KeyringBackend):
@classmethod
def priority(cls):
"""
High-priority if there are backends to chain, otherwise 0.
If there are backends to chain, high priority
Otherwise very low priority since our operation when empty
is the same as null.
"""
return 10 * (len(cls.backends) > 1)
return 10 if len(cls.backends) > 1 else -10
@properties.ClassProperty
@classmethod