Bug 640093

Summary: python-cheetah just plain broke.
Product: [Fedora] Fedora Reporter: Bowe Strickland <bowe>
Component: python-cheetahAssignee: Mike Bonnet <mikeb>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: dmalcolm, jlaska, mikeb, rnovacek
Target Milestone: ---Keywords: CommonBugs
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: https://fedoraproject.org/wiki/Common_F14_bugs#python_cheetah
Fixed In Version: python-cheetah-2.4.3-1.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-28 05:52:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 620817    
Attachments:
Description Flags
output of "/usr/bin/cheetah test" none

Description Bowe Strickland 2010-10-04 19:15:41 UTC
[bowe@station166 ~]$ rpm -V python-cheetah
[bowe@station166 ~]$ rpm -q python-cheetah
python-cheetah-2.4.2.1-2.fc14.x86_64
[bowe@station166 ~]$ uname -a
Linux station166.rosemont.lan 2.6.35.4-28.fc14.x86_64 #1 SMP Wed Sep 15 01:56:54 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
[bowe@station166 ~]$ cat /etc/redhat-release
Fedora release 14 (Laughlin)

all packages updated from fedora, updates, and updates-testing as of this filing.

first, "cheetah test" fails...

[bowe@station166 ~]$ cheetah test
Traceback (most recent call last):
  File "/usr/local/bin/cheetah", line 4, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2675, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 552, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Cheetah==2.2.1


secondly, every time I try to generate text calling str(template) on a 
cheetah.Template object, I get the same error, exemplified by this essentially cut and pasted from the Documentation...

cat > /tmp/t << EOF
from Cheetah.Template import Template
templateDef = """
<HEAD><TITLE>$title</TITLE></HEAD>
<BODY>
$contents
</BODY></HTML>"""
nameSpace = {'title': 'Hello World Example', 'contents': 'Hello World!'}
t = Template(templateDef, searchList=[nameSpace])
print t
EOF

[bowe@station166 ~]$ python /tmp/t
Traceback (most recent call last):
  File "/tmp/t", line 9, in <module>
    print t
  File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1005, in __str__
    rc = getattr(self, mainMethName)()
TypeError: unbound method respond() must be called with DynamicallyCompiledCheetahTemplate instance as first argument (got nothing instead)

Comment 1 Bowe Strickland 2010-10-04 19:41:28 UTC
Created attachment 451506 [details]
output of "/usr/bin/cheetah test"

Comment 2 Bowe Strickland 2010-10-04 19:42:44 UTC
Okay, a stale /usr/local/bin/cheetah was getting in the way.

output of "/usr/bin/cheetah test" attached, with many failures, all similar to failures i'm seeing...

--b

Comment 3 Mike Bonnet 2010-10-04 19:49:38 UTC
Yes, these look like issues with Python 2.7.  I'm looking into it.

Comment 4 Dave Malcolm 2010-10-15 20:09:39 UTC
Looks a lot like:
  http://github.com/rtyler/cheetah/issues#issue/2
which has a proposed fix

See also:
  http://github.com/rtyler/cheetah/issues#issue/3

Comment 5 James Laska 2010-10-15 20:27:06 UTC
Also, looks like python-cheetah.spec is calling teh testsuite during %check, but not properly handling the return code from the test suite.  Should that be changed in the future so that python-cheetah fails to build if the test suite fails?

http://kojipkgs.fedoraproject.org/packages/python-cheetah/2.4.2.1/2.fc14/data/logs/i686/build.log

Comment 6 Mike Bonnet 2010-10-15 20:32:09 UTC
%check should fail if the test suite returns a non-zero error code.  It looks like Test.py may not be doing that.  I'll look into fixing that too.

Comment 7 Fedora Update System 2010-10-18 19:59:29 UTC
python-cheetah-2.4.3-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/python-cheetah-2.4.3-1.fc14

Comment 8 Mike Bonnet 2010-10-18 20:07:12 UTC
I applied the fix suggested in issue2 above, which fixed most of the errors.  The rest of the failing tests were the EOL issues mentioned in issue3, so I've disabled those 3 EOL tests for now.  The patches can be seen here:

http://pkgs.fedoraproject.org/gitweb/?p=python-cheetah.git;a=tree;h=refs/heads/f14/master;hb=f14/master

Please test the update packages and do the karma dance in bodhi as appropriate.

Thanks!

Comment 9 Fedora Update System 2010-10-19 09:05:07 UTC
python-cheetah-2.4.3-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-cheetah'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/python-cheetah-2.4.3-1.fc14

Comment 10 James Laska 2010-10-26 19:45:18 UTC
I'm still having trouble getting cobbler to properly serve up content over http.  However, I've confirmed that kickstart templates (cheetah-based) work properly from the command-line.  I'll need to dig into the cobbler html issues, but I suspect they are different issues.

Comment 11 Fedora Update System 2010-10-28 05:52:27 UTC
python-cheetah-2.4.3-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.