-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python code is not allowed: Sub() if there's dash in resource id while template job uses template-filter #1223
Labels
bug
Something isn't working
Comments
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1434.
|
baconYao
changed the title
Python code is not allowed: Sub() if there's dash in resource id while template job use template-filter
Python code is not allowed: Sub() if there's dash in resource id while template job uses template-filter
May 3, 2024
Unable to reproduce this issue if resource id uses underscoreid: try-resource-underscore
unit: test plan
_name: Try resource dash
_description: Test
bootstrap_include:
demo_dash_resource
include:
demo/demo_dash_success
id: demo_dash_resource
_summary: Try resource id has dash
_description: Problem occurs while resource id has dash
estimated_duration: 0.02
category_id: com.canonical.plainbox::info
plugin: resource
command:
echo "key: 123"
echo ""
echo "key: 456"
echo ""
echo ""
unit: template
template-engine: jinja2
template-resource: demo_dash_resource
template-unit: job
template-filter: demo_dash_resource.key == "456"
template-id: demo/demo_dash_success
id: demo/go_{{ key }}
_summary: Try demo_dash_resource
plugin: shell
category_id: com.canonical.plainbox::info
estimated_duration: 1s
command:
echo "Success with 'demo-dash-resource' resource job" Resultcheckbox.checkbox-cli run com.canonical.certification::try-resource-underscore 1 ✘ 5s 13:38:45
$PROVIDERPATH is defined, so following provider sources are ignored ['/home/baconyao/.local/share/plainbox-providers-1', '/var/tmp/checkbox-providers-develop']
Using sideloaded provider: checkbox-provider-base, version 4.0.0.dev254 from /var/tmp/checkbox-providers/base
Skipped file: /var/tmp/checkbox-providers/base/units/stress/suspend_cycles_reboot.md
=========================[ Running Selected Test Plan ]=========================
==============[ Running job 1 / 1. Estimated time left: 0:00:01 ]===============
---------------------------[ Try demo_dash_resource ]---------------------------
ID: com.canonical.certification::demo/go_456
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Success with 'demo-dash-resource' resource job
------------------------------------------------------------------------- >8 ---
Outcome: job passed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2024-05-03T05.39.36
==================================[ Results ]===================================
☑ : Try demo_dash_resource
|
According to the Checkbox Document, the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
The
plainbox.impl.resource.CodeNotAllowed: this kind of python code is not allowed: Sub()
exception be thrown while a template job use template-filter to filter a resource job whose id has dash.To Reproduce
Reproducible by the follow code
Environment
OS: Class and UC
Checkbox Version:
Relevant log output
The text was updated successfully, but these errors were encountered: