Handle missing key-manager service in workflow
This updates the LBaaS v2 workflow so that it does not trip over itself if the key-manager service is not available. It will also ignore servers (available members) that are in a state where they do not have any IP addresses. Partially-Implements: blueprint horizon-lbaas-v2-ui Change-Id: Ia3373653f651e273d021ffedf9c2909810e9ecb9
This commit is contained in:
parent
af63722e3a
commit
f44671ca0e
@ -190,7 +190,9 @@
|
|||||||
neutronAPI.getSubnets().then(onGetSubnets),
|
neutronAPI.getSubnets().then(onGetSubnets),
|
||||||
neutronAPI.getPorts().then(onGetPorts),
|
neutronAPI.getPorts().then(onGetPorts),
|
||||||
novaAPI.getServers().then(onGetServers),
|
novaAPI.getServers().then(onGetServers),
|
||||||
keymanagerPromise.then(prepareCertificates)
|
// The noop errback prevents this from tripping up $q.all since this is a case
|
||||||
|
// where we don't care if it fails, i.e. key-manager service doesn't exist.
|
||||||
|
keymanagerPromise.then(prepareCertificates, angular.noop)
|
||||||
]).then(initMemberAddresses);
|
]).then(initMemberAddresses);
|
||||||
model.context.submit = createLoadBalancer;
|
model.context.submit = createLoadBalancer;
|
||||||
break;
|
break;
|
||||||
@ -200,7 +202,7 @@
|
|||||||
neutronAPI.getSubnets().then(onGetSubnets),
|
neutronAPI.getSubnets().then(onGetSubnets),
|
||||||
neutronAPI.getPorts().then(onGetPorts),
|
neutronAPI.getPorts().then(onGetPorts),
|
||||||
novaAPI.getServers().then(onGetServers),
|
novaAPI.getServers().then(onGetServers),
|
||||||
keymanagerPromise.then(prepareCertificates)
|
keymanagerPromise.then(prepareCertificates, angular.noop)
|
||||||
]).then(initMemberAddresses);
|
]).then(initMemberAddresses);
|
||||||
model.context.submit = createListener;
|
model.context.submit = createListener;
|
||||||
break;
|
break;
|
||||||
@ -419,11 +421,14 @@
|
|||||||
model.members.length = 0;
|
model.members.length = 0;
|
||||||
var members = [];
|
var members = [];
|
||||||
angular.forEach(response.data.items, function addMember(server) {
|
angular.forEach(response.data.items, function addMember(server) {
|
||||||
members.push({
|
// If the server is in a state where it does not have an IP address then we can't use it
|
||||||
id: server.id,
|
if (server.addresses && !angular.equals({}, server.addresses)) {
|
||||||
name: server.name,
|
members.push({
|
||||||
weight: 1
|
id: server.id,
|
||||||
});
|
name: server.name,
|
||||||
|
weight: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
push.apply(model.members, members);
|
push.apply(model.members, members);
|
||||||
}
|
}
|
||||||
|
@ -258,8 +258,9 @@
|
|||||||
|
|
||||||
$provide.value('horizon.app.core.openstack-service-api.nova', {
|
$provide.value('horizon.app.core.openstack-service-api.nova', {
|
||||||
getServers: function() {
|
getServers: function() {
|
||||||
var servers = [ { id: '1', name: 'server-1' },
|
var servers = [ { id: '1', name: 'server-1', addresses: { foo: 'bar' } },
|
||||||
{ id: '2', name: 'server-2' } ];
|
{ id: '2', name: 'server-2', addresses: { foo: 'bar' } },
|
||||||
|
{ id: '3', name: 'server-3' }];
|
||||||
|
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
deferred.resolve({ data: { items: servers } });
|
deferred.resolve({ data: { items: servers } });
|
||||||
|
Loading…
Reference in New Issue
Block a user