CLOUDSTACK-7308: add tags to all security group rules

(cherry picked from commit ae1b87ca23997bcba75bfc7f59e83026e31a68fc)
This commit is contained in:
Wei Zhou 2014-08-18 14:41:53 +02:00
parent de424061b2
commit b035a444c6

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);