mirror of https://github.com/apache/cloudstack.git
make signature calculation consistent across management servers
This commit is contained in:
parent
37b4384990
commit
82fcfe8edc
|
|
@ -17,6 +17,8 @@
|
|||
*/
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import com.cloud.agent.api.LogLevel.Log4jLevel;
|
||||
|
||||
|
||||
|
|
@ -84,6 +86,10 @@ public class SecurityIngressRulesCmd extends Command {
|
|||
this.signature = signature;
|
||||
this.seqNum = seqNum;
|
||||
this.vmId = vmId;
|
||||
if (signature == null) {
|
||||
String stringified = stringifyRules();
|
||||
this.signature = DigestUtils.md5Hex(stringified);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ public class SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl {
|
|||
}
|
||||
Set<Long> workItems = new TreeSet<Long>();
|
||||
workItems.addAll(affectedVms);
|
||||
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Security Group Mgr v2: scheduling ruleset updates for " + affectedVms.size() + " vms " + " (unique=" + workItems.size() + "), current queue size=" + _workQueue.size());
|
||||
}
|
||||
|
|
@ -158,11 +159,11 @@ public class SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl {
|
|||
Long agentId = vm.getHostId();
|
||||
if (agentId != null) {
|
||||
SecurityIngressRulesCmd cmd = generateRulesetCmd(vm.getInstanceName(), vm.getPrivateIpAddress(),
|
||||
vm.getPrivateMacAddress(), vm.getId(), generateRulesetSignature(rules),
|
||||
vm.getPrivateMacAddress(), vm.getId(), null,
|
||||
work.getLogsequenceNumber(), rules);
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("SecurityGroupManager v2: sending ruleset update for vm " + vm.getInstanceName() +
|
||||
": num rules=" + cmd.getRuleSet().length + " num cidrs=" + cmd.getTotalNumCidrs());
|
||||
": num rules=" + cmd.getRuleSet().length + " num cidrs=" + cmd.getTotalNumCidrs() + " sig=" + cmd.getSignature());
|
||||
}
|
||||
Commands cmds = new Commands(cmd);
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue