From 4df8093c30d6a9d20a756e3aeeda89649c2ab981 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Thu, 17 Oct 2013 14:41:01 +0200 Subject: [PATCH] Set a sane default for state_path This change set a sane default to state_path, removed no more used cfg options, and put the previous state_path for tests only. DocImpact Closes bug: #1240879 Change-Id: If56b60950d8ebf9111ef99bfbf2cb549bbb6b29b --- cinder/common/config.py | 9 ++------- cinder/tests/conf_fixture.py | 3 +++ etc/cinder/cinder.conf.sample | 7 ++----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/cinder/common/config.py b/cinder/common/config.py index 4b4703673..969f8c3c1 100644 --- a/cinder/common/config.py +++ b/cinder/common/config.py @@ -25,7 +25,6 @@ stepping stone. """ -import os import socket from oslo.config import cfg @@ -59,13 +58,9 @@ core_opts = [ cfg.StrOpt('api_paste_config', default="api-paste.ini", help='File name for the paste.deploy config for cinder-api'), - cfg.StrOpt('pybasedir', - default=os.path.abspath(os.path.join(os.path.dirname(__file__), - '..', - '..')), - help='Directory where the cinder python module is installed'), cfg.StrOpt('state_path', - default='$pybasedir', + default='/var/lib/cinder', + deprecated_name='pybasedir', help="Top-level directory for maintaining cinder's state"), ] debug_opts = [ diff --git a/cinder/tests/conf_fixture.py b/cinder/tests/conf_fixture.py index 5f88f6348..35ea037be 100644 --- a/cinder/tests/conf_fixture.py +++ b/cinder/tests/conf_fixture.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. +import os from oslo.config import cfg @@ -50,3 +51,5 @@ def set_defaults(conf): conf.set_default('fixed_key', default='0' * 64, group='keymgr') conf.set_default('scheduler_driver', 'cinder.scheduler.filter_scheduler.FilterScheduler') + conf.set_default('state_path', os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..'))) diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index abd56288f..0dc38e061 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -237,13 +237,10 @@ # value) #api_paste_config=api-paste.ini -# Directory where the cinder python module is installed -# (string value) -#pybasedir=/usr/lib/python/site-packages - # Top-level directory for maintaining cinder's state (string # value) -#state_path=$pybasedir +# Deprecated group/name - [DEFAULT]/pybasedir +#state_path=/var/lib/cinder # ip address of this host (string value) #my_ip=10.0.0.1 -- 2.45.2