← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1442543] [NEW] oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/neutron/neutron.conf

 

Public bug reported:

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.

** Affects: neutron
     Importance: Undecided
     Assignee: Ihar Hrachyshka (ihar-hrachyshka)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1442543

Title:
  oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some
  config files: /etc/neutron/neutron.conf

Status in OpenStack Neutron (virtual network service):
  In Progress

Bug description:
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1442543/+subscriptions


Follow ups

References