Merge ~andreserl/maas:2.2_lp1507712 into maas:2.2
Proposed by
Andres Rodriguez
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andres Rodriguez | ||||
Approved revision: | 9f1a33aa86a568880747574c37d1bd01dafe31a4 | ||||
Merge reported by: | MAAS Lander | ||||
Merged at revision: | not available | ||||
Proposed branch: | ~andreserl/maas:2.2_lp1507712 | ||||
Merge into: | maas:2.2 | ||||
Diff against target: |
105 lines (+38/-2) 2 files modified
src/maascli/config.py (+26/-1) src/maascli/tests/test_config.py (+12/-1) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andres Rodriguez (community) | Approve | ||
Review via email: mp+331000@code.launchpad.net |
Commit message
Backport dd962958f73efb9
LP: #1507712 - cli: maas logout causes KeyError for other profiles
There is a race where when profiles are being deleted, if this happens
between the __iter__ and __getitem__ (of a different invocation of the
cli) which are two different SQL queries, there is an inconsistent view.
So instead use a cache with a consistent view of the data. This
guarantees correct -- if stale behavior in the cli.
Note that this is acceptable because when running two commands at the
same time ordering is unknown and the cache only lives for the lifetime
of a single command.
To post a comment you must log in.
selfie as it is a backport!