Issue 66 in hntool: hntool crashes

2 views
Skip to first unread message

hnt...@googlecode.com

unread,
Jan 10, 2011, 10:59:56 AM1/10/11
to hnt...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 66 by uli.armbruster: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

What steps will reproduce the problem?
1. Install hntool on Archlinux from the AUR with some little changes in the
PKGBUILD so hntool is being installed with python2 as dependency rather
than python, which in Archlinux equals python version 3
2. execute e.g. hntool -t html

What is the expected output? What do you see instead?
I don't exactly remember the expected output, but what I get is:
# hntool -t html
[ Starting HnTool checks... ]
Traceback (most recent call last):
File "/usr/bin/hntool", line 29, in <module>
hn.run_tests()
File "/usr/lib/python2.7/site-packages/HnTool/core.py", line 221, in
run_tests
'results': self.rule_modules[m].analyze(self.options)})
File "/usr/lib/python2.7/site-packages/HnTool/modules/filesystems.py",
line 57, in analyze
datafile = locate_database[os_type]
UnboundLocalError: local variable 'os_type' referenced before assignment

What version of the product are you using? On what operating system?
I'm using hntool version 0.1.2, python version 2.7.1 and lsof version 4.84
on Archlinux i686.

Please provide any additional information below.
No more information available

hnt...@googlecode.com

unread,
Jan 15, 2011, 3:49:01 PM1/15/11
to hnt...@googlegroups.com
Updates:
Owner: hugodoria

Comment #1 on issue 66 by linux.r...@gmail.com: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

(No comment was entered for this change.)

hnt...@googlecode.com

unread,
Jan 26, 2011, 9:42:25 PM1/26/11
to hnt...@googlegroups.com

Comment #2 on issue 66 by eltonplima: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

Please test if this patch resolv this problem.
This patch solve this issue and 64 too.

Attachments:
hntool.diff 727 bytes

hnt...@googlecode.com

unread,
Jan 26, 2011, 10:48:02 PM1/26/11
to hnt...@googlegroups.com
Updates:
Owner: linux.rafa

Comment #3 on issue 66 by linux.r...@gmail.com: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

I think we should find the real cause of this bug.

Put this code, we can fixed the bug, but we really don't know the real root
cause.

hnt...@googlecode.com

unread,
Feb 1, 2011, 12:31:51 PM2/1/11
to hnt...@googlegroups.com

Comment #4 on issue 66 by eltonplima: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

This problem occurs because the variable is out of scope. The error says
that the variable is being referenced os_type before having an assigned
value.
It is interesting that ALL the variables are declared and initialized
(usually as None) early in the function or class.

hnt...@googlecode.com

unread,
Feb 1, 2011, 1:24:46 PM2/1/11
to hnt...@googlegroups.com

Comment #5 on issue 66 by uli.armb...@googlemail.com: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

Sorry for the delay, eltonplima, the patch doesn't change the fact that
hntool crashes. Here's the new output.

# hntool -t html
[ Starting HnTool checks... ]
Traceback (most recent call last):
File "/usr/bin/hntool", line 29, in <module>
hn.run_tests()
File "/usr/lib/python2.7/site-packages/HnTool/core.py", line 221, in
run_tests
'results': self.rule_modules[m].analyze(self.options)})
File "/usr/lib/python2.7/site-packages/HnTool/modules/filesystems.py",

line 58, in analyze
datafile = locate_database[os_type]
KeyError: None

hnt...@googlecode.com

unread,
Feb 23, 2011, 9:18:19 AM2/23/11
to hnt...@googlegroups.com

Comment #6 on issue 66 by th.geist: hntool crashes
http://code.google.com/p/hntool/issues/detail?id=66

What about changing the if-else chain to include an "else" that reports
that mlocate or locate must be installed?

Reply all
Reply to author
Forward
0 new messages