This commit is contained in:
Anu Chandy 2012-05-08 16:53:51 -07:00
Родитель a723137514 64fc4dd6d6
Коммит 34f12a1b13
1 изменённых файлов: 18 добавлений и 16 удалений

Просмотреть файл

@ -289,16 +289,18 @@ exports.enumDeployments = function(channel, options, callback) {
if (error) {
options.errs.push(error);
callback();
} else {
var hostedServices = response.body;
if (hostedServices.length === 0) {
callback();
}
return;
}
var hostedServices = response.body;
if (hostedServices.length === 0) {
callback();
return;
}
for (var i = 0; i < hostedServices.length; i++) {
options.dnsPrefix = hostedServices[i].ServiceName;
getDeploymentSlot();
}
for (var i = 0; i < hostedServices.length; i++) {
options.dnsPrefix = hostedServices[i].ServiceName;
getDeploymentSlot();
}
});
}
@ -310,7 +312,7 @@ exports.enumDeployments = function(channel, options, callback) {
* @param {string} name The display name or location name. Required
* @param {function} callback The callback function called on completion. Required.
*/
exports.resolveLocationName = function(channel, name, callBack) {
exports.resolveLocationName = function(channel, name, callback) {
doServiceManagementOperation(channel, 'listLocations', function(error, response) {
if (!error) {
if (response.body.length > 0) {
@ -318,7 +320,7 @@ exports.resolveLocationName = function(channel, name, callBack) {
for (var i = 0; i < response.body.length; i++) {
locationInfo = response.body[i];
if (locationInfo.Name === name) {
callBack(null, name);
callback(null, name);
return;
} else if(!resolvedName && (locationInfo.DisplayName === name)) {
// This is the first matched display name save the corresponding location
@ -329,16 +331,16 @@ exports.resolveLocationName = function(channel, name, callBack) {
}
if(resolvedName) {
callBack(null, resolvedName);
callback(null, resolvedName);
} else {
callBack({message : 'No location found which has DisplayName or Name same as value of --location', code: 'Not Found'}, name);
callback({message : 'No location found which has DisplayName or Name same as value of --location', code: 'Not Found'}, name);
}
} else {
// Return a valid error
callBack({message : 'Server returns empty location list', code: 'Not Found'}, name);
callback({message : 'Server returns empty location list', code: 'Not Found'}, name);
}
} else {
callBack(error, name);
callback(error, name);
}
});
};
@ -358,4 +360,4 @@ exports.getUTCTimeStamp = function() {
('0'+now.getUTCDate()).slice(-2) + ' ' +
('0'+now.getUTCHours()).slice(-2) + ':' +
('0'+now.getUTCMinutes()).slice(-2));
}
}