Bug 1229559

Summary: oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/neutron/neutron.conf
Product: Red Hat OpenStack Reporter: Arie Bregman <abregman>
Component: openstack-neutronAssignee: Ihar Hrachyshka <ihrachys>
Status: CLOSED ERRATA QA Contact: Ofer Blaut <oblaut>
Severity: low Docs Contact:
Priority: low    
Version: 7.0 (Kilo)CC: apevec, chrisw, ihrachys, lhh, lnatapov, lpeer, nyechiel, scohen, yeylon
Target Milestone: gaKeywords: OtherQA
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-neutron-2015.1.0-6.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-05 13:25:10 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:

Description Arie Bregman 2015-06-09 05:32:24 UTC
Description of problem:

When running lbaas unit tests on a system where neutron.conf is installed into /etc/neutron, and if the file does not have read permissions for the user running unit tests, I get the following error:

{0} neutron_lbaas.tests.unit.services.loadbalancer.agent.test_agent.TestLbaasService.test_main [0.113960s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "neutron_lbaas/tests/unit/services/loadbalancer/agent/test_agent.py", line 45, in test_main
        agent.main()
      File "neutron_lbaas/services/loadbalancer/agent/agent.py", line 58, in main
        common_config.init(sys.argv[1:]){0} neutron_lbaas.tests.unit.services.loadbalancer.agent.test_agent.TestLbaasService.test_main [0.113960s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "neutron_lbaas/tests/unit/services/loadbalancer/agent/test_agent.py", line 45, in test_main
        agent.main()
      File "neutron_lbaas/services/loadbalancer/agent/agent.py", line 58, in main
        common_config.init(sys.argv[1:])
      File "/home/ihrachyshka/proj/openstack/neutron-lbaas/.tox/py27/src/neutron/neutron/common/config.py", line 185, in init
        **kwargs)
      File "/home/ihrachyshka/proj/openstack/neutron-lbaas/.tox/py27/lib/python2.7/site-packages/oslo_config/cfg.py", line 1856, in __call__
        self._namespace._files_permission_denied)
    oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/neutron/neutron.conf

      File "/home/ihrachyshka/proj/openstack/neutron-lbaas/.tox/py27/src/neutron/neutron/common/config.py", line 185, in init
        **kwargs)
      File "/home/ihrachyshka/proj/openstack/neutron-lbaas/.tox/py27/lib/python2.7/site-packages/oslo_config/cfg.py", line 1856, in __call__
        self._namespace._files_permission_denied)
    oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/neutron/neutron.conf

This is because oslo.config tries to autodiscover config files, and read them, in case they exist. Unit tests should be isolated from those files.

Comment 3 Ihar Hrachyshka 2015-06-09 10:43:41 UTC
This blocks CI effort for lbaas.

Comment 4 Ihar Hrachyshka 2015-06-09 14:37:24 UTC
For QE: this is a test only change, so we can even safely merge it before ga. Not sure whether any QE involvement is need here at all.

Comment 6 Ihar Hrachyshka 2015-06-15 12:34:09 UTC
Test only change, no need for doc text.

Comment 7 Leonid Natapov 2015-07-21 12:50:08 UTC
openstack-neutron-2015.1.0-12.el7ost.noarch

verified.

Comment 9 errata-xmlrpc 2015-08-05 13:25:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2015:1548