0

I want to set the some variable in nova-api.

Which is the best way to set that? (in nova.conf or in other file?)

I can set in /etc/nova/nova.conf and get the value of that variable in the api. But is there any other way to set environment variable for the API? I want to access by os.environ in the script. (Is this the right way to access or not?)

As per my knowledge, for the wsgi we have to set in the apache's config file. But for nova I cant find the file :(.

Thanks in advance for the help.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
Nilesh
  • 20,521
  • 16
  • 92
  • 148
  • SetEnv in Apache does not set os.environ for mod_wsgi if when you said 'wsgi' you actually meant mod_wsgi. – Graham Dumpleton Oct 18 '12 at 00:05
  • I am expecting first reply from @GrahamDumpleton :). I set the env variable from the `init.d` script. In the scrip `/etc/init.d/openstack-nova-api` one file is used `/etc/sysconfig/$prog` so we set the `export` variable in this file and got the reference later. Thx for your reply. – Nilesh Oct 18 '12 at 04:12
  • For Linux systems, one of the init.d files, set as normal shell variable usually works. If a traditional Apache Software Foundation distribution of Apache, would use the envvars file in same directory as Apache executable. – Graham Dumpleton Oct 18 '12 at 04:42
  • You can also just set os.environ at the start of the WSGI script file. For a lot of things where is only Python modules reading it, that is fine. Doing it in init.d/envars only needed if something like LANG/LC_ALL/LD_LIBRARY_PATH where needed on process start of Apache. – Graham Dumpleton Oct 18 '12 at 04:43

1 Answers1

1

Set the env variable from the init.d script. In the scrip /etc/init.d/openstack-nova-api one file is used /etc/sysconfig/$prog so we set the export variable in this file and got the reference later.

Nilesh
  • 20,521
  • 16
  • 92
  • 148