Initialize metadata definitions catalog
This patch copies all files from /etc/metadefs to /etc/glance/metadefs and calls glance-manage db_load_metadefs after successful database migration. This covers whole process of initializing the metadata catalog. Change-Id: I2ffd19bf543708b42229ef78dd17ee317f58e6ad Implements: blueprint glance-metadata-definitions-support Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
This commit is contained in:
committed by
Travis Tripp
parent
ba842f5374
commit
76e3925dc4
11
lib/glance
11
lib/glance
@@ -34,6 +34,7 @@ GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
|
||||
GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
|
||||
|
||||
GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
|
||||
GLANCE_METADEF_DIR=$GLANCE_CONF_DIR/metadefs
|
||||
GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf
|
||||
GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf
|
||||
GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini
|
||||
@@ -81,6 +82,11 @@ function configure_glance {
|
||||
fi
|
||||
sudo chown $STACK_USER $GLANCE_CONF_DIR
|
||||
|
||||
if [[ ! -d $GLANCE_METADEF_DIR ]]; then
|
||||
sudo mkdir -p $GLANCE_METADEF_DIR
|
||||
fi
|
||||
sudo chown $STACK_USER $GLANCE_METADEF_DIR
|
||||
|
||||
# Copy over our glance configurations and update them
|
||||
cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
|
||||
iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
@@ -177,6 +183,8 @@ function configure_glance {
|
||||
|
||||
cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
|
||||
cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON
|
||||
|
||||
cp -p $GLANCE_DIR/etc/metadefs/*.json $GLANCE_METADEF_DIR
|
||||
}
|
||||
|
||||
# create_glance_accounts() - Set up common required glance accounts
|
||||
@@ -241,6 +249,9 @@ function init_glance {
|
||||
# Migrate glance database
|
||||
$GLANCE_BIN_DIR/glance-manage db_sync
|
||||
|
||||
# Load metadata definitions
|
||||
$GLANCE_BIN_DIR/glance-manage db_load_metadefs
|
||||
|
||||
create_glance_cache_dir
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user