summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-02-26 00:47:14 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2009-02-26 00:47:14 +0000
commitc252c6b68111dcc9689fd2c6d3970ed88e43ecb7 (patch)
treef97c36e1602d00081dbc2a43a8c05a4250357361 /server
parent9b8f5b33b4cc264dc153b144632f9b1ad8508418 (diff)
Have autoserv_parser parse an empty argument list when initialized to
set default values to its configured options. This should fix broken codepaths that assume they are always reached from autoserv when in fact in certain cases they are reached from other standalone programs (like the scheduler). Signed-off-by: Mihai Rusu <dizzy@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2829 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'server')
-rw-r--r--server/autoserv_parser.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/autoserv_parser.py b/server/autoserv_parser.py
index d25d804d..7fe8fa85 100644
--- a/server/autoserv_parser.py
+++ b/server/autoserv_parser.py
@@ -16,6 +16,12 @@ class base_autoserv_parser(object):
self.parser = optparse.OptionParser()
self.setup_options()
+ # parse an empty list of arguments in order to set self.options
+ # to default values so that codepaths that assume they are always
+ # reached from an autoserv process (when they actually are not)
+ # will still work
+ self.options, self.args = self.parser.parse_args(args=[])
+
def setup_options(self):
self.parser.add_option("-m", action="store", type="string",
@@ -97,7 +103,7 @@ class base_autoserv_parser(object):
def parse_args(self):
- (self.options, self.args) = self.parser.parse_args()
+ self.options, self.args = self.parser.parse_args()
site_autoserv_parser = utils.import_site_class(