Set a sane default for state_path

This change sets a sane default to state_path and puts the previous
state_path for tests only.

Because the default value of state_path changed, if this one isn't set in the
configuration file, pybasedir is not more used as replacement but /var/lib/nova
is used instead.

UpgradeImpact
DocImpact
Closes bug: #1240879

Change-Id: I94502bcfac8b372271acd0dbc1710c0e3009b8e1
This commit is contained in:
Mehdi Abaakouk 2013-10-17 15:08:51 +02:00
parent 27e353c336
commit 27ced7a09b
3 changed files with 6 additions and 2 deletions

View File

@ -97,7 +97,7 @@
# Top-level directory for maintaining nova's state (string
# value)
#state_path=$pybasedir
#state_path=/var/lib/nova
#

View File

@ -31,7 +31,7 @@ path_opts = [
default=os.path.join(sys.prefix, 'local', 'bin'),
help='Directory where nova binaries are installed'),
cfg.StrOpt('state_path',
default='$pybasedir',
default='/var/lib/nova',
help="Top-level directory for maintaining nova's state"),
]

View File

@ -16,6 +16,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
from oslo.config import cfg
@ -43,6 +45,8 @@ class ConfFixture(config_fixture.Config):
"""Fixture to manage global conf settings."""
def setUp(self):
super(ConfFixture, self).setUp()
self.conf.set_default('state_path', os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..')))
self.conf.set_default('api_paste_config',
paths.state_path_def('etc/nova/api-paste.ini'))
self.conf.set_default('host', 'fake-mini')