From ae1b87ca23997bcba75bfc7f59e83026e31a68fc Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 18 Aug 2014 14:41:53 +0200 Subject: [PATCH] CLOUDSTACK-7308: add tags to all security group rules --- .../cloud/api/query/dao/SecurityGroupJoinDaoImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java index d2844044eb8..bb4df1dd556 100644 --- a/server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/SecurityGroupJoinDaoImpl.java @@ -172,6 +172,16 @@ public class SecurityGroupJoinDaoImpl extends GenericDaoBase tags = _resourceTagJoinDao.listBy(vsg.getRuleUuid(), ResourceTag.ResourceObjectType.SecurityGroupRule); + Set tagResponse = new HashSet(); + 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);