londiste: make --expect-sync work
authorMarko Kreen <markokr@gmail.com>
Mon, 8 Jun 2009 14:27:49 +0000 (17:27 +0300)
committerMarko Kreen <markokr@gmail.com>
Mon, 8 Jun 2009 14:27:49 +0000 (17:27 +0300)
python/londiste/setup.py

index ae8567cd48e998bed270f388ac29e3c91f9f6efa..584199196cf29f947a0ca1c3a83dad5224eeee85 100644 (file)
@@ -149,8 +149,12 @@ class LondisteSetup(CascadeAdmin):
             self.log.warning('Table "%s" missing on subscriber, use --create if necessary' % tbl)
             return
 
+        # actual table registration
         q = "select * from londiste.local_add_table(%s, %s)"
         self.exec_cmd(dst_curs, q, [self.set_name, tbl])
+        if self.options.expect_sync:
+            q = "select * from londiste.set_table_state(%s, %s, NULL, 'ok')"
+            self.exec_cmd(dst_curs, q, [self.set_name, tbl])
         dst_db.commit()
 
     def sync_table_list(self, dst_curs, src_tbls, dst_tbls):