Bug 967781
Summary: | oslo-config overwrites cli argument values by values from config file | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Attila Fazekas <afazekas> |
Component: | python-oslo-config | Assignee: | Jakub Libosvar <jlibosva> |
Status: | CLOSED DUPLICATE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | afazekas, chrisw, fpercoco, hateya, jhenner, jkt, jlibosva, lpeer, markmc, ndipanov, rohara, rvaknin, yeylon |
Target Milestone: | Upstream M3 | ||
Target Release: | 4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-12-09 15:58:40 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 989661 | ||
Bug Blocks: |
Description
Attila Fazekas
2013-05-28 10:34:25 UTC
Well if I start it by init script, it does log to /var/log/quantum/lbaas-agent.log Is log_file being set in quantum.conf? It seems that --log-file will be ignored if log_file is set in quantum.conf. # egrep ^log_file /etc/quantum/quantum.conf log_file=/tmp/quantum.log # quantum-lbaas-agent --log-file /var/log/quantum/lbaas-agent.log --config-file /etc/quantum/quantum.conf --config-file /etc/quantum/lbaas_agent.ini --debug --verbose 2013-07-19 10:14:48 INFO [quantum.common.config] Logging enabled! 2013-07-19 10:14:48 INFO [quantum.openstack.common.rpc.impl_qpid] Connected to AMQP server on 10.15.85.141:5672 2013-07-19 10:14:48 INFO [quantum.openstack.common.rpc.impl_qpid] Connected to AMQP server on 10.15.85.141:5672 # cat /var/log/quantum/lbaas-agent.log cat: /var/log/quantum/lbaas-agent.log: No such file or directory # cat /tmp/quantum.log 2013-07-19 10:14:48 INFO [quantum.common.config] Logging enabled! 2013-07-19 10:14:48 INFO [quantum.openstack.common.rpc.impl_qpid] Connected to AMQP server on 10.15.85.141:5672 2013-07-19 10:14:48 INFO [quantum.openstack.common.rpc.impl_qpid] Connected to AMQP server on 10.15.85.141:5672 2013-07-19 10:15:21 INFO [quantum.openstack.common.service] Caught SIGINT, exiting Note that if log_file is *not* set in quantum.conf, quantum-lbaas-agent will log to the file given via --log-file. This is only a bug if the command-line option "--log-file" is expected to take precedence over the "log_file" parameter in the config file. Yes my expectation is the command-line options always takes precedence to anything else. 1. CLI options 2. Environment variables 3. Configuration file (4. distribution defaults) 5. Application defaults I've tested this scenario in rhos 4.0 on rhel 6.5 (puddle 2013-10-28.2), I've installed the env using packstack and my neutron.conf be default mentions only the log_dir (which is /var/log/neutron) so by default all the agents logs are written well and in the right location: # ll /var/log/neutron/ total 116 -rw-r--r--. 1 neutron neutron 9392 Nov 6 12:21 l3-agent.log -rw-r--r--. 1 neutron neutron 2977 Nov 6 12:50 lbaas-agent.log -rw-r--r--. 1 neutron neutron 154 Nov 6 12:11 metadata-agent.log -rw-r--r--. 1 root root 77 Nov 6 12:12 neutron-ns-metadata-proxy-e6e9549f-e6a9-4070-9df1-6a1f332aecb0.log -rw-r--r--. 1 neutron neutron 15686 Nov 6 12:21 openvswitch-agent.log -rw-r--r--. 1 neutron neutron 266 Nov 6 12:11 ovs-cleanup.log -rw-r--r--. 1 neutron neutron 66489 Nov 6 12:50 server.log I tried to add log_file to the neutron.conf, it indeed looks like a bug - the process' "--config-file" is ignored and the logging are written to the location specified in neutron.conf. This issue is more severe, it's not related to lbaas but to config that's used by all agents. According https://bugs.launchpad.net/oslo/+bug/1176817/comments/2 this is expected behavior. If you pass arguments --foo bar --config-file baz.conf and in baz.conf is defined foo=baz, then bar value will be overwritten by baz. If you pass arguments in different order: --config-file baz.conf --foo bar, then foo will have value bar. Changing component to oslo to decide whether this is bug or not. *** This bug has been marked as a duplicate of bug 960670 *** |