dev-conf is now supported

Change-Id: Ifef175f0c6e712ec66076189db4e1464c2333fa3
This commit is contained in:
Sergey Lukjanov 2013-03-23 23:36:08 +04:00
parent 4f6ac6406b
commit f7ba6ad247
3 changed files with 26 additions and 5 deletions

2
.gitignore vendored
View File

@ -32,3 +32,5 @@ doc/build
nosetests.xml
pylint-report.txt
etc/local.cfg
etc/savanna/savanna.conf
etc/savanna.conf

View File

@ -15,11 +15,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from eventlet import wsgi
import os
import sys
import eventlet
from eventlet import wsgi
from oslo.config.cfg import CONF
import sys
# If ../savanna/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'savanna',
'__init__.py')):
sys.path.insert(0, possible_topdir)
from savanna import config
import savanna.main as server
from savanna.openstack.common import log as logging
@ -28,7 +39,15 @@ LOG = logging.getLogger(__name__)
def main():
config.parse_args(sys.argv[1:])
dev_conf = os.path.join(possible_topdir,
'etc',
'savanna',
'savanna.conf')
config_files = None
if os.path.exists(dev_conf):
config_files = [dev_conf]
config.parse_args(sys.argv[1:], config_files)
logging.setup("savanna")
app = server.make_app()

View File

@ -34,5 +34,5 @@ CONF = cfg.CONF
CONF.register_cli_opts(cli_opts)
def parse_args(argv):
CONF(argv, project='savanna')
def parse_args(argv, conf_files):
CONF(argv, project='savanna', default_config_files=conf_files)