Hardcoded Paths in Common Python Files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo-incubator |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I was trying to use an alternative path for keystone, glance, and nova and I kept running into an issue were some of the tools didn't know where to find the configs.
The services themselves seem to have a --config-dir option but there are some things that don't.
Right now the two I keep hitting are the openstack-db script and the cfg.py that's in openstack/common dir in the various python site-package dirs for the services.
## cfg.py
/usr/lib/
/usr/lib/
/usr/lib/
lines:
395 os.path.
396 '/etc'
## openstack-db
/usr/bin/
lines:
116 APP_CONFIG=
117 else
118 APP_CONFIG=
In both cases I'm adding openstack so that the final paths are /etc/openstack/
It would be nice if there was a --config-dir option for openstack-db and maybe have cfg.py check for that.
affects: | openstack-ci → oslo |
I found another one:
/usr/lib/ python2. 6/site- packages/ quantum- 2013.1- py2.6.egg/ quantum/ common/ utils.py
It's not honoring the config-dir option and instead using a set of hardcoded paths.
95 fix_path( os.path. join('~ ', '.local', etc/quantum' ,
96 'etc', 'quantum')),
97 '/usr/etc/quantum',
98 '/usr/local/
99 '/etc/quantum/',
100 '/etc']
This was preventing the quantum-server from locating the policy.json file:
2012-10-01 14:01:45 ERROR [quantum. api.v2. resource] create failed python2. 6/site- packages/ quantum- 2013.1- py2.6.egg/ quantum/ api/v2/ resource. py", line 95, in resource request= request, **args) python2. 6/site- packages/ quantum- 2013.1- py2.6.egg/ quantum/ api/v2/ base.py" , line 290, in create self._plugin) python2. 6/site- packages/ quantum- 2013.1- py2.6.egg/ quantum/ policy. py", line 191, in enforce python2. 6/site- packages/ quantum- 2013.1- py2.6.egg/ quantum/ policy. py", line 50, in init PolicyNotFound( path=cfg. CONF.policy_ file)
Traceback (most recent call last):
File "/usr/lib/
result = method(
File "/usr/lib/
plugin=
File "/usr/lib/
init()
File "/usr/lib/
raise exceptions.
PolicyNotFound: Policy configuration policy.json could not be found
By adding my path /etc/openstack/ quantum, I was able to successfully create a new network with net-create.
I do start quantum-server with the --config-dir option.
/usr/bin/ quantum- server --config-dir /etc/openstack/ quantum --log-file /var/log/ openstack/ quantum- server. log