summaryrefslogtreecommitdiff
path: root/python/pgqadm.py
diff options
context:
space:
mode:
authorMarko Kreen2008-02-28 10:01:09 +0000
committerMarko Kreen2008-02-28 10:01:09 +0000
commit8d358469aee6dab496e2b00e60b8843c1eec97c1 (patch)
treeec2b52ddd14c74785b5e5aad52b212205fc4fe59 /python/pgqadm.py
parentcb88da31a88004b592228a99169ce77082863987 (diff)
pgqadm avoid queue_ prefix from -stable
Diffstat (limited to 'python/pgqadm.py')
-rwxr-xr-xpython/pgqadm.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/python/pgqadm.py b/python/pgqadm.py
index b436efd6..9ae9c0a0 100755
--- a/python/pgqadm.py
+++ b/python/pgqadm.py
@@ -132,7 +132,10 @@ class PGQAdmin(skytools.DBScript):
for el in self.args[3:]:
k, v = el.split('=')
if k not in config_allowed_list:
- raise Exception('unknown config var: '+k)
+ qk = "queue_" + k
+ if qk not in config_allowed_list:
+ raise Exception('unknown config var: '+k)
+ k = qk
expr = "%s=%s" % (k, skytools.quote_literal(v))
alist.append(expr)
self.log.info('Change queue %s config to: %s' % (qname, ", ".join(alist)))
@@ -164,9 +167,16 @@ class PGQAdmin(skytools.DBScript):
res = curs.dictfetchone()
db.commit()
+ if res is None:
+ print "no such queue:", qname
+ return
+
print qname
for k in config_allowed_list:
- print " %s\t=%7s" % (k, res[k])
+ n = k
+ if k[:6] == "queue_":
+ n = k[6:]
+ print " %s\t=%7s" % (n, res[k])
def get_queue_list(self):
db = self.get_database('db')