mirror of https://github.com/apache/cloudstack.git
Fixed few coverity issues reported
This commit is contained in:
parent
fd96ad02d7
commit
5efded3ae9
|
|
@ -297,26 +297,27 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||
|
||||
public void sendStartup(Link link) {
|
||||
final StartupCommand[] startup = _resource.initialize();
|
||||
final Command[] commands = new Command[startup.length];
|
||||
for (int i = 0; i < startup.length; i++) {
|
||||
setupStartupCommand(startup[i]);
|
||||
commands[i] = startup[i];
|
||||
}
|
||||
if (startup != null) {
|
||||
final Command[] commands = new Command[startup.length];
|
||||
for (int i = 0; i < startup.length; i++) {
|
||||
setupStartupCommand(startup[i]);
|
||||
commands[i] = startup[i];
|
||||
}
|
||||
final Request request = new Request(_id != null ? _id : -1, -1, commands, false, false);
|
||||
request.setSequence(getNextSequence());
|
||||
|
||||
final Request request = new Request(_id != null ? _id : -1, -1, commands, false, false);
|
||||
request.setSequence(getNextSequence());
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Sending Startup: " + request.toString());
|
||||
}
|
||||
synchronized (this) {
|
||||
_startup = new StartupTask(link);
|
||||
_timer.schedule(_startup, _startupWait);
|
||||
}
|
||||
try {
|
||||
link.send(request.toBytes());
|
||||
} catch (final ClosedChannelException e) {
|
||||
s_logger.warn("Unable to send reques: " + request.toString());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Sending Startup: " + request.toString());
|
||||
}
|
||||
synchronized (this) {
|
||||
_startup = new StartupTask(link);
|
||||
_timer.schedule(_startup, _startupWait);
|
||||
}
|
||||
try {
|
||||
link.send(request.toBytes());
|
||||
} catch (final ClosedChannelException e) {
|
||||
s_logger.warn("Unable to send reques: " + request.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,11 +120,10 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||
}
|
||||
|
||||
private void disableRpFilter() {
|
||||
try {
|
||||
FileWriter fstream = new FileWriter("/proc/sys/net/ipv4/conf/eth2/rp_filter");
|
||||
BufferedWriter out = new BufferedWriter(fstream);
|
||||
try (FileWriter fstream = new FileWriter("/proc/sys/net/ipv4/conf/eth2/rp_filter");
|
||||
BufferedWriter out = new BufferedWriter(fstream);)
|
||||
{
|
||||
out.write("0");
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
s_logger.warn("Unable to disable rp_filter");
|
||||
}
|
||||
|
|
@ -242,18 +241,18 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||
|
||||
if (_localgw != null) {
|
||||
String mgmtHost = (String)params.get("host");
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
||||
|
||||
String internalDns1 = (String)params.get("internaldns1");
|
||||
if (internalDns1 == null) {
|
||||
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
||||
} else {
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
||||
}
|
||||
|
||||
String internalDns2 = (String)params.get("internaldns2");
|
||||
if (internalDns2 != null) {
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
||||
if (_eth1ip != null) {
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
||||
String internalDns1 = (String) params.get("internaldns1");
|
||||
if (internalDns1 == null) {
|
||||
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
||||
} else {
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
||||
}
|
||||
String internalDns2 = (String) params.get("internaldns2");
|
||||
if (internalDns2 != null) {
|
||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue