noise
authormartinko <gamato@users.sf.net>
Fri, 22 Feb 2013 13:29:44 +0000 (14:29 +0100)
committermartinko <gamato@users.sf.net>
Fri, 22 Feb 2013 13:29:44 +0000 (14:29 +0100)
python/londiste/setup.py
python/pgq/cascade/admin.py
python/pgq/cascade/worker.py

index c54e26444fb9608c37f1fcc10b28b6278231a5d3..d7463de7030e3b59a4a862b979087bb24933a362 100644 (file)
@@ -536,7 +536,6 @@ class LondisteSetup(CascadeAdmin):
             self.provider_location = res[0]['provider_location']
         return self.get_database('provider_db', connstr = self.provider_location)
 
-
     def expand_arg_list(self, db, kind, existing, args, needs_tbl=True):
         curs = db.cursor()
 
@@ -570,7 +569,6 @@ class LondisteSetup(CascadeAdmin):
             else:
                 return lst_missing
 
-
         allow_nonexist = not needs_tbl
         if existing:
             res = self.solve_globbing(args, lst_exists, map_exists, map_missing, allow_nonexist)
@@ -578,7 +576,6 @@ class LondisteSetup(CascadeAdmin):
             res = self.solve_globbing(args, lst_missing, map_missing, map_exists, allow_nonexist)
         return res
 
-
     def solve_globbing(self, args, full_list, full_map, reverse_map, allow_nonexist):
         def glob2regex(s):
             s = s.replace('.', '[.]').replace('?', '.').replace('*', '.*')
index 3c7b51fed46ad46ad6c63bc4522d43c65f4aba41..58fa16e3c8622f6ba85aee380190601788336b95 100644 (file)
@@ -2,13 +2,12 @@
 
 ## NB: not all commands work ##
 
-"""cascaded queue administration.
+"""Cascaded queue administration.
 
 londiste.py INI pause [NODE [CONS]]
 
 setadm.py INI pause NODE [CONS]
 
-
 """
 
 import sys, time, optparse, skytools, os.path
@@ -67,7 +66,7 @@ setadm extra switches:
 
 
 class CascadeAdmin(skytools.AdminScript):
-    """Cascaded pgq administration."""
+    """Cascaded PgQ administration."""
     queue_name = None
     queue_info = None
     extra_objs = []
@@ -243,7 +242,6 @@ class CascadeAdmin(skytools.AdminScript):
                           [ self.queue_name, node_type, node_name, worker_name,
                             provider_name, global_watermark, combined_queue ])
 
-
         self.extra_init(node_type, db, provider_db)
 
         if node_attrs:
@@ -267,7 +265,6 @@ class CascadeAdmin(skytools.AdminScript):
         while 1:
             db = self.get_database('root_db', connstr = loc)
 
-
             # query current status
             res = self.exec_query(db, "select * from pgq_node.get_node_info(%s)", [self.queue_name])
             info = res[0]
@@ -558,9 +555,6 @@ class CascadeAdmin(skytools.AdminScript):
             except skytools.DBError, d:
                 self.log.warning("Failed to remove from '%s': %s", n.name, str(d))
 
-
-
-
     def node_depends(self, sub_node, top_node):
         cur_node = sub_node
         # walk upstream
@@ -604,7 +598,6 @@ class CascadeAdmin(skytools.AdminScript):
             if info.completed_tick >= last_tick:
                 return info
 
-
     def takeover_root(self, old_node_name, new_node_name, failover = False):
         """Root switchover."""
 
@@ -955,7 +948,7 @@ class CascadeAdmin(skytools.AdminScript):
                 node_db.commit()
                 if len(cons_rows) == 1:
                     if prov_node:
-                        raise Exception('Unexcpeted situation: there are two gravestones - on nodes %s and %s' % (prov_node, node_name))
+                        raise Exception('Unexpected situation: there are two gravestones - on nodes %s and %s' % (prov_node, node_name))
                     prov_node = node_name
                     failover_tick = cons_rows[0]['last_tick']
                     self.log.info("Found gravestone on node: %s", node_name)
index b5d56a878f444e708c1be8aac805584fb4326878..dbe6ba3c6e680c3a773a4cb5d18f8c513a9c6d13 100644 (file)
@@ -121,7 +121,7 @@ class CascadedWorker(CascadedConsumer):
 
     def __init__(self, service_name, db_name, args):
         """Initialize new consumer.
-        
+
         @param service_name: service_name for DBScript
         @param db_name: target database name for get_database()
         @param args: cmdline args for DBScript
@@ -444,4 +444,3 @@ class CascadedWorker(CascadedConsumer):
         dst_curs.execute(q, [self.pgq_queue_name])
         dst_db.commit()
         self.global_wm_publish_time = t
-