From a758451f12322559c48dd107f985742d36cec217 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Thu, 3 Nov 2016 12:03:56 -0400 Subject: [PATCH] RIFT-14984: show only available VIM in instantiate. Display warning when one more more are unable to connect Signed-off-by: Laurence Maultsby --- .../widgets/skyquake_container/skyquakeContainerStore.js | 4 ++-- skyquake/plugins/launchpad/api/launchpad.js | 2 +- .../plugins/launchpad/src/instantiate/instantiateStore.js | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js index aa4e7448f..d1a8a9e28 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js @@ -173,8 +173,8 @@ class SkyquakeContainerStore { } else { state.notificationMessage = data.msg; - if(data.type == 'success') { - state.notificationType = 'success'; + if(data.type) { + state.notificationType = data.type; } } this.setState(state); diff --git a/skyquake/plugins/launchpad/api/launchpad.js b/skyquake/plugins/launchpad/api/launchpad.js index 96818e040..509ff776b 100644 --- a/skyquake/plugins/launchpad/api/launchpad.js +++ b/skyquake/plugins/launchpad/api/launchpad.js @@ -1664,7 +1664,7 @@ VDUR.consoleUrl.get = function(req) { CloudAccount.get = function(req) { var api_server = req.query["api_server"]; var uri = utils.confdPort(api_server); - uri += APIVersion + '/api/config/cloud/account?deep'; + uri += APIVersion + '/api/operational/cloud/account?deep'; var headers = _.extend({}, constants.HTTP_HEADERS.accept.collection, { 'Authorization': req.get('Authorization') }); diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index 94ba391bb..2e6e24236 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -131,7 +131,13 @@ class LaunchNetworkServiceStore { } getLaunchCloudAccountSuccess(cloudAccounts) { let newState = {}; - newState.cloudAccounts = cloudAccounts || []; + newState.cloudAccounts = cloudAccounts.filter(function(v) { + console.log(v) + return v['connection-status'].status == 'success'; + }) || []; + if(cloudAccounts.length != newState.cloudAccounts.length) { + Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'}); + } if(cloudAccounts && cloudAccounts.length > 0) { newState.selectedCloudAccount = cloudAccounts[0]; if (cloudAccounts[0]['account-type'] == 'openstack') { -- 2.25.1