Merge "fix external nic name miss match bug"

This commit is contained in:
Jenkins 2016-01-12 02:41:24 +00:00 committed by Gerrit Code Review
commit 83f0f26589
2 changed files with 28 additions and 17 deletions

View File

@ -333,16 +333,20 @@ define(['./baseController'], ()->
$scope.updateExternalNetwork = (network_name) ->
nic = $scope.external[network_name]
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips[network_name].start.split('.')[3]
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips[network_name].end.split('.')[3]
if network_name == 'external'
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips.external.public_vip.split('.')[3]
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips.external.gw_ip.split('.')[3]
try
if $scope.interfaces[nic]
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips[network_name].start.split('.')[3]
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips[network_name].end.split('.')[3]
if network_name == 'external'
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips.external.public_vip.split('.')[3]
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0,3).join('.') +
'.' + $scope.ips.external.gw_ip.split('.')[3]
catch error
console.log(error)
return
defaultCfg = ->

View File

@ -428,14 +428,21 @@
}
};
$scope.updateExternalNetwork = function(network_name) {
var nic;
var error, nic;
nic = $scope.external[network_name];
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet;
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].start.split('.')[3];
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].end.split('.')[3];
if (network_name === 'external') {
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.public_vip.split('.')[3];
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.gw_ip.split('.')[3];
try {
if ($scope.interfaces[nic]) {
$scope.ips[network_name].cidr = $scope.interfaces[nic].subnet;
}
$scope.ips[network_name].start = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].start.split('.')[3];
$scope.ips[network_name].end = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips[network_name].end.split('.')[3];
if (network_name === 'external') {
$scope.ips.external.public_vip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.public_vip.split('.')[3];
$scope.ips.external.gw_ip = $scope.ips[network_name].cidr.split('.').slice(0, 3).join('.') + '.' + $scope.ips.external.gw_ip.split('.')[3];
}
} catch (_error) {
error = _error;
console.log(error);
}
};
defaultCfg = function() {