lp:~zyga/checkbox/fix-developer-decorators
- Get this branch:
- bzr branch lp:~zyga/checkbox/fix-developer-decorators
Branch merges
- Maciej Kisielewski: Approve
-
Diff: 117 lines (+57/-21)2 files modifiedplainbox/plainbox/impl/developer.py (+53/-21)
plainbox/plainbox/impl/session/assistant.py (+4/-0)
Branch information
Recent revisions
- 3959. By Zygmunt Krynicki
-
plainbox:developer: fix support for decorated functions
This patch fixes an interesting issue where the
UsageExpection.of(self) .enforce( back=2) code would misbehave on
decorated functions. In general, the code really allowed the decorator,
not the function hiding behind it.The fix involves a number of operations.
First the UsageExpectation class no longer caches anything about the
allowed_calls dictionary. Since the dictionary can be mutated
externally (without re-assignment) it's simply useless to do that.
Instead everything is computed on demand in enforce().Next, the code uses the __wrapped__ attribute (if present) to discover
the true function that the user is allowed to call. This actually breaks
all the existing code (that relied on the bug that made it work before)
so another change is made.Lastly, an off-by-one bug is now detected. When
UsageExpectation.of(self) .enforce( back=2) is used when plain .enforce()
is actually correct a warning is logged, pointing to the appropriate
location with instructions on what to change.Signed-off-by: Zygmunt Krynicki <email address hidden>
- 3958. By Zygmunt Krynicki
-
plainbox:
session: assistant: allow calls to transport creation methods This patch grants permissions to call two transport creation methods.
They are currently working because of a bug in the developer usage
expectation system that is fixed with the subsequent commit.Signed-off-by: Zygmunt Krynicki <email address hidden>
- 3957. By Zygmunt Krynicki
-
"automatic merge of lp:~zyga/checkbox/fix-resume/ by tarmac [r=zyga]
[bug=][ author= zyga]" - 3956. By Zygmunt Krynicki
-
"automatic merge of lp:~zyga/checkbox/snappy-1473947/ by tarmac [r=zyga]
[bug=][ author= zyga]" - 3955. By Jeff Lane
-
"automatic merge of lp:~bladernr/checkbox/checkbox-merge-ocp-block_device_resource/ by tarmac [r=roadmr]
[bug=][ author= bladernr] " - 3954. By Po-Hsu Lin
-
"automatic merge of lp:~cypressyew/checkbox/sync-test-after-s3-input/ by tarmac [r=zyga][bug=1486338][author=
cypressyew] " - 3953. By Sylvain Pineau
-
"automatic merge of lp:~kissiel/checkbox/mandatory-jobs/ by tarmac [r=zyga][bug=1391774][author=kissiel]"
- 3952. By Jeff Lane
-
"automatic merge of lp:~bladernr/checkbox/checkbox-replace-disk-detect/ by tarmac [r=zyga][bug=1483829][author=bladernr]"
- 3950. By Jeff Lane
-
"automatic merge of lp:~bladernr/checkbox/1486089-efi-only-x86/ by tarmac [r=zyga][bug=1486089][author=bladernr]"
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:checkbox