Change checking cinder v1 to check v2 in panels

In general, in the case where there is no cinder v1 endpoint created
(or deleted - use openstack service delete cinder to reproduce) certain
volume related menu entries are not displayed

This patch add a a new function to check cinder v2/v3 endpoints instead
of only checking the v1 endpoint in instance launch model.

Also, in the image panel, instead of checking v1 endpoint,
it should check v2 and v3 as well.

Change-Id: I642b2f62bb9502f958593c9fcad76e21ee1c80ad
Closes-Bug: #1670789
This commit is contained in:
Lucas H. Xu 2017-03-23 16:39:58 -04:00
parent 34e56199db
commit 5ced2f87ef
3 changed files with 16 additions and 4 deletions

View File

@ -545,8 +545,13 @@
var volumeDeferred = $q.defer();
var volumeSnapshotDeferred = $q.defer();
serviceCatalog
.ifTypeEnabled('volume')
.then(onVolumeServiceEnabled, resolvePromises);
.ifTypeEnabled('volumev2')
.then(onVolumeServiceEnabled, onCheckVolumeV3);
function onCheckVolumeV3() {
serviceCatalog
.ifTypeEnabled('volumev3')
.then(onVolumeServiceEnabled, resolvePromises);
}
function onVolumeServiceEnabled() {
model.volumeBootable = true;
novaExtensions

View File

@ -242,7 +242,9 @@
if (theType === 'network' && neutronEnabled) {
deferred.resolve();
} else if (theType === 'volume' && cinderEnabled) {
} else if (theType === 'volumev2' && cinderEnabled) {
deferred.resolve();
} else if (theType === 'volumev3' && cinderEnabled) {
deferred.resolve();
} else {
deferred.reject();

View File

@ -72,7 +72,12 @@
function initAction() {
createVolumePromise = policy.ifAllowed({rules: [['volume', 'volume:create']]});
volumeServiceEnabledPromise = serviceCatalog.ifTypeEnabled('volume');
if (serviceCatalog.ifTypeEnabled('volumev2') ||
serviceCatalog.ifTypeEnabled('volumev3')) {
volumeServiceEnabledPromise = true;
} else {
volumeServiceEnabledPromise = false;
}
}
function allowed(image) {