Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1060735 - traceback in malformed jinja_render block
Summary: traceback in malformed jinja_render block
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: devassistant
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-03 13:32 UTC by Tomáš Bžatek
Modified: 2015-03-03 23:07 UTC (History)
3 users (show)

Fixed In Version: devassistant-0.9.3-2.fc22 devassistant-0.9.3-2.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-09 14:09:43 UTC


Attachments (Terms of Use)
a yaml file that reproduces the problem (deleted)
2014-02-03 13:32 UTC, Tomáš Bžatek
no flags Details
python traceback (deleted)
2014-02-03 13:32 UTC, Tomáš Bžatek
no flags Details
a yaml file that reproduces the problem (deleted)
2014-02-03 15:58 UTC, Tomáš Bžatek
no flags Details
[PATCH] Allow unicode string for the jinja_render/destination argument (deleted)
2014-02-03 16:16 UTC, Tomáš Bžatek
no flags Details | Diff
[PATCH] Allow unicode strings for jinja_render arguments (deleted)
2014-02-04 16:46 UTC, Tomáš Bžatek
no flags Details | Diff

Description Tomáš Bžatek 2014-02-03 13:32:05 UTC
Created attachment 858576 [details]
a yaml file that reproduces the problem

Description of problem:
Similar to bug 1059305, I'm getting traceback in processing input yaml file. This should fail with a nice message.

Version-Release number of selected component (if applicable):
devassistant-0.8.0-1.fc21.noarch with patch from bug 1059305 applied

How reproducible:
always

Steps to Reproduce:
1. put the attached yaml file in ~/.devassistant/assistants/crt/c
2. da crt c -n MujProjekt openlmi

Actual results:
>   File "/usr/lib/python2.7/site-packages/devassistant/lang.py", line 194, in is_var
>     return string.startswith('$')
> AttributeError: 'NoneType' object has no attribute 'startswith'

Comment 1 Tomáš Bžatek 2014-02-03 13:32:29 UTC
Created attachment 858577 [details]
python traceback

Comment 2 Tomáš Bžatek 2014-02-03 15:58:53 UTC
Created attachment 858669 [details]
a yaml file that reproduces the problem

Wrong yaml file attached, posting the correct one.

Found the problem - arguments in the "jinja_render:" block were badly indented and data were not populated internally. This was not obvious from the traceback and no yaml parser errors were spit out.

Comment 3 Tomáš Bžatek 2014-02-03 16:16:29 UTC
Created attachment 858695 [details]
[PATCH] Allow unicode string for the jinja_render/destination argument

A small related fix that makes my data not being ignored.

Comment 4 Tomáš Bžatek 2014-02-04 16:46:20 UTC
Created attachment 859237 [details]
[PATCH] Allow unicode strings for jinja_render arguments

Updated patch, turned out both the template/source and destination arguments need to use unicode strings. Further development of my assistant proved this to be crucial and working.

Comment 5 Bohuslav "Slavek" Kabrda 2014-02-25 14:21:28 UTC
I fixed this a bit differently using python-six, that we started to use (so that we can be compatible with both Python 2 and 3). The commit is at [1] and it'll be part of next upstream release, which should make it to Fedora 21, I assume.

[1] https://github.com/bkabrda/devassistant/commit/90f0929524365ba7d088de7b00d3d2076efc2a16

Comment 6 Bohuslav "Slavek" Kabrda 2014-12-09 14:09:43 UTC
Fixed as of DevAssistant 0.9.0, e.g. F21 and later.


Note You need to log in before you can comment on or make changes to this bug.