use of com.cloud.agent.api.CleanupNetworkRulesCmd in project cloudstack by apache.
the class NotAValidCommand method testCleanupNetworkRulesCmdNullDetails.
@Test
public void testCleanupNetworkRulesCmdNullDetails() {
final CleanupNetworkRulesCmd cleanupNets = new CleanupNetworkRulesCmd(20);
final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
assertNotNull(wrapper);
when(citrixResourceBase.canBridgeFirewall()).thenReturn(false);
final Answer answer = wrapper.execute(cleanupNets, citrixResourceBase);
assertTrue(answer.getResult());
assertNull(answer.getDetails());
}
use of com.cloud.agent.api.CleanupNetworkRulesCmd in project cloudstack by apache.
the class SecurityGroupListener method processConnect.
@Override
public void processConnect(Host host, StartupCommand cmd, boolean forRebalance) {
if (s_logger.isInfoEnabled())
s_logger.info("Received a host startup notification");
if (cmd instanceof StartupRoutingCommand) {
//if (Boolean.toString(true).equals(host.getDetail("can_bridge_firewall"))) {
try {
int interval = MIN_TIME_BETWEEN_CLEANUPS + _cleanupRandom.nextInt(MIN_TIME_BETWEEN_CLEANUPS / 2);
CleanupNetworkRulesCmd cleanupCmd = new CleanupNetworkRulesCmd(interval);
Commands c = new Commands(cleanupCmd);
_agentMgr.send(host.getId(), c, this);
if (s_logger.isInfoEnabled())
s_logger.info("Scheduled network rules cleanup, interval=" + cleanupCmd.getInterval());
} catch (AgentUnavailableException e) {
//usually hypervisors that do not understand sec group rules.
s_logger.debug("Unable to schedule network rules cleanup for host " + host.getId(), e);
}
if (_workTracker != null) {
_workTracker.processConnect(host.getId());
}
}
}
Aggregations