Skip to content

Commit f25baf3

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Initialize metadata definitions catalog"
2 parents 4bd4264 + 76e3925 commit f25baf3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/glance

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
3434
GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
3535

3636
GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
37+
GLANCE_METADEF_DIR=$GLANCE_CONF_DIR/metadefs
3738
GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf
3839
GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf
3940
GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini
@@ -81,6 +82,11 @@ function configure_glance {
8182
fi
8283
sudo chown $STACK_USER $GLANCE_CONF_DIR
8384

85+
if [[ ! -d $GLANCE_METADEF_DIR ]]; then
86+
sudo mkdir -p $GLANCE_METADEF_DIR
87+
fi
88+
sudo chown $STACK_USER $GLANCE_METADEF_DIR
89+
8490
# Copy over our glance configurations and update them
8591
cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
8692
iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
@@ -177,6 +183,8 @@ function configure_glance {
177183

178184
cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
179185
cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON
186+
187+
cp -p $GLANCE_DIR/etc/metadefs/*.json $GLANCE_METADEF_DIR
180188
}
181189

182190
# create_glance_accounts() - Set up common required glance accounts
@@ -241,6 +249,9 @@ function init_glance {
241249
# Migrate glance database
242250
$GLANCE_BIN_DIR/glance-manage db_sync
243251

252+
# Load metadata definitions
253+
$GLANCE_BIN_DIR/glance-manage db_load_metadefs
254+
244255
create_glance_cache_dir
245256
}
246257

0 commit comments

Comments
 (0)