From 4c91fe786c8a357697f598444c2f65c22afb84e8 Mon Sep 17 00:00:00 2001 From: Anu Chandy Date: Tue, 8 May 2012 17:13:21 -0700 Subject: [PATCH] Fixing issue of not showing proper message in case of no endpoints --- lib/cli/commands/vm.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/cli/commands/vm.js b/lib/cli/commands/vm.js index fa1b35baf..1afc73ab9 100644 --- a/lib/cli/commands/vm.js +++ b/lib/cli/commands/vm.js @@ -1307,7 +1307,7 @@ exports.init = function(cli) { ConfigurationSets: configurationSets }; - progress = cli.progress('Updating nework configuration'); + progress = cli.progress('Updating network configuration'); utils.doServiceManagementOperation(channel, 'modifyRole', found.svc, found.deploy.Name, options.name, vmRole, function(error, response) { progress.end(); @@ -1356,11 +1356,15 @@ exports.init = function(cli) { // got unique role under a deployment and service, list the endpoints if (found) { - logger.table(found.roleInstance.InstanceEndpoints, function(row, item) { - row.cell('Name', item.Name); - row.cell('External Port', item.PublicPort); - row.cell('Local Port', item.LocalPort); - }); + if (!found.roleInstance.InstanceEndpoints || found.roleInstance.InstanceEndpoints.length === 0) { + logger.info('No endpoints found'); + } else { + logger.table(found.roleInstance.InstanceEndpoints, function(row, item) { + row.cell('Name', item.Name); + row.cell('External Port', item.PublicPort); + row.cell('Local Port', item.LocalPort); + }); + } } else { return cmdCallback('No VMs found'); }