summaryrefslogtreecommitdiff
path: root/python/skytools/adminscript.py
diff options
context:
space:
mode:
authorMarko Kreen2013-03-20 15:17:15 +0000
committerMarko Kreen2013-03-20 15:17:15 +0000
commit805ff65a57bea4a8cdc0bee677cc406581b5114f (patch)
treeb72b72ae867447fce7ca8951c05ea1f1838959d6 /python/skytools/adminscript.py
parent5a53f0c62c7ef557280ed781e9d90182a064d426 (diff)
adminscripts: make info commands not use pidfile
otherwise they conflict with change operations.
Diffstat (limited to 'python/skytools/adminscript.py')
-rw-r--r--python/skytools/adminscript.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/skytools/adminscript.py b/python/skytools/adminscript.py
index 7ec16e75..8ef00f7d 100644
--- a/python/skytools/adminscript.py
+++ b/python/skytools/adminscript.py
@@ -16,16 +16,22 @@ class AdminScript(skytools.DBScript):
name. If class method 'cmd_' + arg exists, it is called,
otherwise error is given.
"""
+ commands_without_pidfile = {}
def __init__(self, service_name, args):
"""AdminScript init."""
skytools.DBScript.__init__(self, service_name, args)
- if self.pidfile:
- self.pidfile = self.pidfile + ".admin"
if len(self.args) < 2:
self.log.error("need command")
sys.exit(1)
+ cmd = self.args[1]
+ if cmd in self.commands_without_pidfile:
+ self.pidfile = None
+
+ if self.pidfile:
+ self.pidfile = self.pidfile + ".admin"
+
def work(self):
"""Non-looping work function, calls command function."""