From 37816d9db2278887808ba153a5f4ce84bea7f17b Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 1 Jun 2010 16:55:29 +0300 Subject: skytools.DBObject: remove duplicated file find logic --- python/skytools/sqltools.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'python/skytools/sqltools.py') diff --git a/python/skytools/sqltools.py b/python/skytools/sqltools.py index 76d73efa..197bbe15 100644 --- a/python/skytools/sqltools.py +++ b/python/skytools/sqltools.py @@ -437,20 +437,7 @@ class DBObject(object): def find_file(self): """Find install script file.""" - full_fn = None - if self.sql_file[0] == "/": - full_fn = self.sql_file - else: - dir_list = skytools.installer_config.sql_locations - for fdir in dir_list: - fn = os.path.join(fdir, self.sql_file) - if os.path.isfile(fn): - full_fn = fn - break - - if not full_fn: - raise Exception('File not found: '+self.sql_file) - return full_fn + return installer_find_file(self.sql_file) class DBSchema(DBObject): """Handles db schema.""" -- cgit v1.2.3