From 3512e137312a33d88e074d0a1613e37165277f3c Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 7 May 2010 14:30:32 +0300 Subject: [PATCH] londiste add-table: --trigger-arg switch to set custom params --- python/londiste.py | 2 ++ python/londiste/setup.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/londiste.py b/python/londiste.py index a224be2f..1939b2d0 100755 --- a/python/londiste.py +++ b/python/londiste.py @@ -109,6 +109,8 @@ class Londiste(skytools.DBScript): help = "takeover: old node was root") g.add_option("--dead-branch", action = 'store_true', help = "takeover: old node was branch") + p.add_option("--trigger-arg", action="append", + help="add: Custom trigger arg") p.add_option_group(g) return p diff --git a/python/londiste/setup.py b/python/londiste/setup.py index b7e7b966..b3adabef 100644 --- a/python/londiste/setup.py +++ b/python/londiste/setup.py @@ -51,6 +51,8 @@ class LondisteSetup(CascadeAdmin): help="include all tables", default=False) p.add_option("--create-only", help="pkey,fkeys,indexes") + p.add_option("--trigger-arg", action="append", + help="Custom trigger arg") return p def extra_init(self, node_type, node_db, provider_db): @@ -152,8 +154,9 @@ class LondisteSetup(CascadeAdmin): return # actual table registration - q = "select * from londiste.local_add_table(%s, %s)" - self.exec_cmd(dst_curs, q, [self.set_name, tbl]) + tgargs = self.options.trigger_arg # None by default + q = "select * from londiste.local_add_table(%s, %s, %s)" + self.exec_cmd(dst_curs, q, [self.set_name, tbl, tgargs]) if self.options.expect_sync: q = "select * from londiste.local_set_table_state(%s, %s, NULL, 'ok')" self.exec_cmd(dst_curs, q, [self.set_name, tbl]) -- 2.39.5