CLOUDSTACK-7308: add tags to all security group rules

This commit is contained in:
Wei Zhou 2014-08-18 14:41:53 +02:00
parent b55c114932
commit ae1b87ca23
1 changed files with 10 additions and 0 deletions

View File

@ -172,6 +172,16 @@ public class SecurityGroupJoinDaoImpl extends GenericDaoBase<SecurityGroupJoinVO
ruleData.setCidr(vsg.getRuleAllowedSourceIpCidr());
}
// add the tags to the rule data
List<ResourceTagJoinVO> tags = _resourceTagJoinDao.listBy(vsg.getRuleUuid(), ResourceTag.ResourceObjectType.SecurityGroupRule);
Set<ResourceTagResponse> tagResponse = new HashSet<ResourceTagResponse>();
for (ResourceTagJoinVO tag: tags) {
tagResponse.add(ApiDBUtils.newResourceTagResponse(tag, false));
}
// add the tags to the rule data
ruleData.setTags(tagResponse);
if (vsg.getRuleType() == SecurityRuleType.IngressRule) {
ruleData.setObjectName("ingressrule");
vsgData.addSecurityGroupIngressRule(ruleData);