#256: CWD override does not work
----------------------+-----------------------------------------------------
Reporter: kparal | Owner: kparal
Type: defect | Status: new
Priority: critical | Milestone: 0.4.4
Component: core | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Comment (by jlaska):
Oh I see ... oops!
{{{
# ln -s python lib/autoqa
# PYTHONPATH=lib ./autoqa -h
Traceback (most recent call last):
File "./autoqa", line 51, in <module>
conf = cfg_parser.get_section('general', conf)
File "/home/devel/jlaska/CVS/autoqa.git/lib/autoqa/config.py", line 80,
in get_section
items = dict(self.items(section))
File "/usr/lib64/python2.7/ConfigParser.py", line 589, in items
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'general'
}}}
The following (lightly tested) patch at least addresses the traceback, and
appears to load the autoqa.conf form CWD (when none exists in
/etc/autoqa). Does this help?
{{{
diff --git a/autoqa b/autoqa
index f024a4a..0dc1213 100755
--- a/autoqa
+++ b/autoqa
@@ -31,9 +31,8 @@ import socket
import copy
import fnmatch
from subprocess import call
-from autoqa.config import SingleConfigParser, getbool
+from autoqa.config import autoqa_conf, getbool
-cfgfile = '/etc/autoqa/autoqa.conf'
# Hardcoded defaults for the 'general' section
conf = {
'local': 'false',
@@ -43,13 +42,8 @@ conf = {
'autotest_server': socket.gethostname(),
}
-# It would be nice to import autoqa_conf here (instead of parsing it
manually),
-# but we need to modify it a little bit (in prep_controlfile) and
ConfigParser
-# unfortunately doesn't support deepcopy
-cfg_parser = SingleConfigParser()
-cfg_parser.read(cfgfile)
-conf = cfg_parser.get_section('general', conf)
-conf = cfg_parser.get_section('notifications', conf)
+conf = autoqa_conf.get_section('general', conf)
+conf = autoqa_conf.get_section('notifications', conf)
# we don't need to catch errors here, bcz we want autoqa to crash for
invalid config
def prep_controlfile(controlfile, extradata):
}}}
{{{
# PYTHONPATH=lib ./autoqa -h
Can't find hooks in /usr/share/autoqa. Check your installation.
}}}
--
Ticket URL: <
https://fedorahosted.org/autoqa/ticket/256#comment:3>
AutoQA <
http://autoqa.fedorahosted.org>
Automated QA project