Merge ~sylvain-pineau/plainbox-provider-resource:fake_package_res_snappy into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 89ad9323bd82f7547a6cddccdafd96698e1daa1d
Merged at revision: f95a281c3400acd98665d6949751867a2da0e74f
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fake_package_res_snappy
Merge into: plainbox-provider-resource:master
Diff against target: 13 lines (+1/-1)
1 file modified
jobs/resource.pxu (+1/-1)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+325750@code.launchpad.net

Description of the change

See commit msg for details.

In short this patch makes the package resource to return at least one fake object on snappy.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

It unblocks this particular case using the package resource, so I'm +1 for that.

It sounds like the expression is expecting to search a list of objects to test the expression. Would it not be reasonable to modify plainbox such that a resource job that "passed" but produced no resource objects returns a single "False" outcome rather causing the expression to fail?

review: Approve
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

From plainbox ctrl code:

When expressions fail then all the associated resources are
marked as failed since we don't want to get into the analysis
of logic expressions to know any "better".

https://git.launchpad.net/plainbox/tree/plainbox/impl/ctrl.py#n184

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jobs/resource.pxu b/jobs/resource.pxu
2index 41ea29d..fb5d173 100644
3--- a/jobs/resource.pxu
4+++ b/jobs/resource.pxu
5@@ -121,7 +121,7 @@ id: package
6 estimated_duration: 1.16
7 plugin: resource
8 command:
9- dpkg-query -W -f='name: ${Package}\nversion: ${Version}\nmodalias: ${Modaliases}\n\n' |\
10+ dpkg-query -W -f='name: ${Package}\nversion: ${Version}\nmodalias: ${Modaliases}\n\n' || echo name: plainbox |\
11 awk 'BEGIN {RS = ""; FS = "\n"}{print $1; print $2; if ($3 ~ /^modalias: .+$/) {print $3}; print "" }'
12 _description: Generates a list of packages
13 _summary: Collect information about installed software packages

Subscribers

People subscribed via source and target branches