Skip to content

Commit

Permalink
Initialize metadata definitions catalog
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pkoniszewski and ttripp committed Sep 8, 2014
1 parent ba842f5 commit 76e3925
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/glance
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 76e3925

Please sign in to comment.