Initialize glance image directory with default value

This patch sets the deafult value of glance image directory
config option 'images_directory' from 'None' to '$state_path/images'.

Closes-Bug: #1643127
Change-Id: I4f7792dc74f36e626b00e000b227b0967ba43700
This commit is contained in:
Pradeep Kumar Singh 2016-11-21 04:59:06 +00:00
parent 1cd691f76f
commit 06f16a321d
2 changed files with 8 additions and 1 deletions

View File

@ -13,6 +13,8 @@
from oslo_config import cfg
from zun.conf import path
image_driver_opts = [
cfg.ListOpt(
'image_driver_list',
@ -31,7 +33,7 @@ Interdependencies to other options:
glance_driver_opts = [
cfg.StrOpt(
'images_directory',
default=None,
default=path.state_path_def('images'),
help='Shared directory where glance images located. If '
'specified, docker will try to load the image from '
'the shared directory by image ID.'),

View File

@ -33,6 +33,11 @@ path_opts = [
]
def state_path_def(*args):
"""Return an uninterpolated path relative to $state_path."""
return os.path.join('$state_path', *args)
def register_opts(conf):
conf.register_opts(path_opts)