Add logs in case ipassoccmd failed

This commit is contained in:
Edison Su 2013-11-20 15:04:31 -08:00
parent 86736d6d4a
commit 2d42b2d1ab
2 changed files with 7 additions and 4 deletions

View File

@ -2048,6 +2048,9 @@ ServerResource {
.getAccessDetail(NetworkElementCommand.ROUTER_NAME); .getAccessDetail(NetworkElementCommand.ROUTER_NAME);
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
String[] results = new String[cmd.getIpAddresses().length]; String[] results = new String[cmd.getIpAddresses().length];
for (int i = 0; i < results.length; i++) {
results[i] = IpAssocAnswer.errorResult;
}
Connect conn; Connect conn;
try { try {
conn = LibvirtConnection.getConnectionByVmName(routerName); conn = LibvirtConnection.getConnectionByVmName(routerName);
@ -2089,17 +2092,16 @@ ServerResource {
ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(), ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(),
ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum, newNic); ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum, newNic);
if (result != null) { if (result == null) {
results[i++] = IpAssocAnswer.errorResult;
} else {
results[i++] = ip.getPublicIp() + " - success"; results[i++] = ip.getPublicIp() + " - success";
;
} }
} }
return new IpAssocAnswer(cmd, results); return new IpAssocAnswer(cmd, results);
} catch (LibvirtException e) { } catch (LibvirtException e) {
s_logger.error("ipassoccmd failed", e);
return new IpAssocAnswer(cmd, results); return new IpAssocAnswer(cmd, results);
} catch (InternalErrorException e) { } catch (InternalErrorException e) {
s_logger.error("ipassoccmd failed", e);
return new IpAssocAnswer(cmd, results); return new IpAssocAnswer(cmd, results);
} }
} }

View File

@ -752,4 +752,5 @@ CREATE VIEW `cloud`.`domain_router_view` AS
and async_job.instance_type = 'DomainRouter' and async_job.instance_type = 'DomainRouter'
and async_job.job_status = 0; and async_job.job_status = 0;
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server', "vmware.vcenter.session.timeout", "1200", "VMware client timeout in seconds", "1200", NULL,NULL,0); INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server', "vmware.vcenter.session.timeout", "1200", "VMware client timeout in seconds", "1200", NULL,NULL,0);
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server', "mgt.server.vendor", "ACS", "the vendor of management server", "ACS", NULL,NULL,0);