handlers.dispatch: fix part_func usage
authorMarko Kreen <markokr@gmail.com>
Fri, 9 Dec 2011 20:26:41 +0000 (22:26 +0200)
committerMarko Kreen <markokr@gmail.com>
Fri, 9 Dec 2011 20:26:41 +0000 (22:26 +0200)
python/londiste/handlers/dispatch.py

index 0ff58bddeff98fc78263d9bb88dc2daa48e68476..95d08e726e0c5f2cf10ed60b0d6fb5ec3fc8c5f9 100644 (file)
@@ -882,12 +882,12 @@ class Dispatcher(BaseHandler):
             self.log.debug('part_template not provided, using part func')
             # if part func exists call it with val arguments
             pfargs = ', '.join('%%(%s)s' % arg for arg in PART_FUNC_ARGS)
-            pfcall = 'select %s(%s)' % (self.part_func, pfargs)
-            if skytools.exists_function(curs, self.part_func, len(PART_FUNC_ARGS)):
+            pfcall = 'select %s(%s)' % (self.conf.part_func, pfargs)
+            if skytools.exists_function(curs, self.conf.part_func, len(PART_FUNC_ARGS)):
                 self.log.debug('check_part.exec: func:%s, args: %s' % (pfcall, vals))
                 curs.execute(pfcall, vals)
             else:
-                self.log.debug('part func %s not found, cloning table' % self.part_func)
+                self.log.debug('part func %s not found, cloning table' % self.conf.part_func)
                 struct = TableStruct(curs, self.dest_table)
                 struct.create(curs, T_ALL, dst)
         exec_with_vals(self.conf.post_part)