From 5aef0e13411fb8ce4e396b9addf65ef5a9ba28a2 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 9 Mar 2012 11:05:13 +0000 Subject: Add pybasedir and bindir options Add a pybasedir option so that it can be used for interpolation in the default values of other options. This helps eliminate hard-coded paths from the sample config file. Also add a bindir option for similar reasons, but it also helps with packaging. Change-Id: Iadc746dcf2a24adbdf9bac945b5b330f01faeeb5 --- nova/flags.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nova/flags.py') diff --git a/nova/flags.py b/nova/flags.py index ece5361c6..38c2258c2 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -102,11 +102,18 @@ core_opts = [ cfg.StrOpt('api_paste_config', default="api-paste.ini", help='File name for the paste.deploy config for nova-api'), + cfg.StrOpt('pybasedir', + default=os.path.abspath(os.path.join(os.path.dirname(__file__), + '../')), + help='Directory where the nova python module is installed'), + cfg.StrOpt('bindir', + default='$pybasedir/bin', + help='Directory where nova binaries are installed'), cfg.StrOpt('state_path', - default=os.path.join(os.path.dirname(__file__), '../'), + default='$pybasedir', help="Top-level directory for maintaining nova's state"), cfg.StrOpt('lock_path', - default=os.path.join(os.path.dirname(__file__), '../'), + default='$pybasedir', help='Directory to use for lock files'), ] -- cgit