Since [1] Glance init depends on either g-api or g-reg being
enabled.
This broke multinode g-api deployments with singlenode database
backend.
This commit aligns Glance with other services w.r.t when to
apply database init.
[1] d8dec362baa2bf7f6ffe1c47352fdbe032eaf20a
Change-Id: Idc07764d6ba3a828f19691f56c73cbe9179c2673
Closes-bug: #1860021
| ... | ... |
@@ -276,16 +276,18 @@ function init_glance {
|
| 276 | 276 |
rm -rf $GLANCE_IMAGE_DIR |
| 277 | 277 |
mkdir -p $GLANCE_IMAGE_DIR |
| 278 | 278 |
|
| 279 |
- # (Re)create glance database |
|
| 280 |
- recreate_database glance |
|
| 279 |
+ if is_service_enabled $DATABASE_BACKENDS; then |
|
| 280 |
+ # (Re)create glance database |
|
| 281 |
+ recreate_database glance |
|
| 281 | 282 |
|
| 282 |
- time_start "dbsync" |
|
| 283 |
- # Migrate glance database |
|
| 284 |
- $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync |
|
| 283 |
+ time_start "dbsync" |
|
| 284 |
+ # Migrate glance database |
|
| 285 |
+ $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync |
|
| 285 | 286 |
|
| 286 |
- # Load metadata definitions |
|
| 287 |
- $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs |
|
| 288 |
- time_stop "dbsync" |
|
| 287 |
+ # Load metadata definitions |
|
| 288 |
+ $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs |
|
| 289 |
+ time_stop "dbsync" |
|
| 290 |
+ fi |
|
| 289 | 291 |
} |
| 290 | 292 |
|
| 291 | 293 |
# install_glanceclient() - Collect source and prepare |