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);
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
String[] results = new String[cmd.getIpAddresses().length];
for (int i = 0; i < results.length; i++) {
results[i] = IpAssocAnswer.errorResult;
}
Connect conn;
try {
conn = LibvirtConnection.getConnectionByVmName(routerName);
@ -2089,17 +2092,16 @@ ServerResource {
ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(),
ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum, newNic);
if (result != null) {
results[i++] = IpAssocAnswer.errorResult;
} else {
if (result == null) {
results[i++] = ip.getPublicIp() + " - success";
;
}
}
return new IpAssocAnswer(cmd, results);
} catch (LibvirtException e) {
s_logger.error("ipassoccmd failed", e);
return new IpAssocAnswer(cmd, results);
} catch (InternalErrorException e) {
s_logger.error("ipassoccmd failed", e);
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.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', "mgt.server.vendor", "ACS", "the vendor of management server", "ACS", NULL,NULL,0);