[hntool] push by linux.rafa - Fixing the UnboundLocalError of the os_type var (Closed: #62)... on 2010-12-07 23:53 GMT

2 views
Skip to first unread message

hnt...@googlecode.com

unread,
Dec 7, 2010, 6:54:32 PM12/7/10
to hnt...@googlegroups.com
Revision: b53a98dc0b
Author: Lincoln de Sousa <lin...@comum.org>
Date: Wed Dec 1 06:20:03 2010
Log: Fixing the UnboundLocalError of the os_type var (Closed: #62)

If locate package is not installed, none of the files nor the updatedb
command are going to be found. So, the os_type var is not declared and
the error happens.
http://code.google.com/p/hntool/source/detail?r=b53a98dc0b

Modified:
/HnTool/modules/filesystems.py

=======================================
--- /HnTool/modules/filesystems.py Sun Aug 22 07:48:58 2010
+++ /HnTool/modules/filesystems.py Wed Dec 1 06:20:03 2010
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8; indent-tabs-mode: 1 -*-
#
# HnTool rules - filesystems
# Copyright (C) 2009-2010 Hugo Doria <ma...@hugodoria.org>
@@ -47,6 +47,12 @@
check_results['info'].append('%s not found. Please run %s' % \
(locate_database['bsd'], updatedb_command['bsd']))
os_type = 'bsd'
+ else:
+ # It seems that we don't have any locate
+ # database present
+ check_results['info'].append('Could not find locate')
+ return check_results
+
elif os.path.isfile(locate_database['bsd']):
check_results['ok'].append('locate.database found.')
os_type = 'bsd'

Reply all
Reply to author
Forward
0 new messages