[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14351739#comment-14351739
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8280:
--------------------------------------------

Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/87#issuecomment-77703465
  
    I solved this privately and forgot to give back to the community. Please 
consider this solution @bhaisaab . It seems to be custom for these 
@transient-annotated fields:
    
    From d39e0251f923620897bc408a58e4bfcfb0c6cdfa Mon Sep 17 00:00:00 2001
    From: Daan Hoogland <[email protected]>
    Date: Mon, 15 Dec 2014 15:58:42 +0100
    Subject: [PATCH 01/14] CLOUDSTACK-8073 load cidrs on create response
    
    ---
     server/src/com/cloud/api/ApiDBUtils.java        | 9 +++++++++
     server/src/com/cloud/api/ApiResponseHelper.java | 3 ++-
     2 files changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/server/src/com/cloud/api/ApiDBUtils.java 
b/server/src/com/cloud/api/ApiDBUtils.java
    index 90a09a0..4895d91 100755
    --- a/server/src/com/cloud/api/ApiDBUtils.java
    +++ b/server/src/com/cloud/api/ApiDBUtils.java
    @@ -201,6 +201,7 @@ import com.cloud.network.security.SecurityGroupManager;
     import com.cloud.network.security.SecurityGroupVO;
     import com.cloud.network.security.dao.SecurityGroupDao;
     import com.cloud.network.vpc.NetworkACL;
    +import com.cloud.network.vpc.NetworkACLItemCidrsDao;
     import com.cloud.network.vpc.StaticRouteVO;
     import com.cloud.network.vpc.VpcGatewayVO;
     import com.cloud.network.vpc.VpcManager;
    @@ -357,6 +358,7 @@ public class ApiDBUtils {
         static ConfigurationDao s_configDao;
         static ConsoleProxyDao s_consoleProxyDao;
         static FirewallRulesCidrsDao s_firewallCidrsDao;
    +    static NetworkACLItemCidrsDao s_networkACLItemCidrsDao;
         static VMInstanceDao s_vmDao;
         static ResourceLimitService s_resourceLimitMgr;
         static ProjectService s_projectMgr;
    @@ -524,6 +526,8 @@ public class ApiDBUtils {
         @Inject
         private FirewallRulesCidrsDao firewallCidrsDao;
         @Inject
    +    private NetworkACLItemCidrsDao networkACLItemCidrsDao;
    +    @Inject
         private VMInstanceDao vmDao;
         @Inject
         private ResourceLimitService resourceLimitMgr;
    @@ -692,6 +696,7 @@ public class ApiDBUtils {
             s_configDao = configDao;
             s_consoleProxyDao = consoleProxyDao;
             s_firewallCidrsDao = firewallCidrsDao;
    +        s_networkACLItemCidrsDao = networkACLItemCidrsDao;
             s_vmDao = vmDao;
             s_resourceLimitMgr = resourceLimitMgr;
             s_projectMgr = projectMgr;
    @@ -1241,6 +1246,10 @@ public class ApiDBUtils {
             return s_firewallCidrsDao.getSourceCidrs(id);
         }
    
    +    public static List<String> findNetworkAclItemSourceCidrs(long id) {
    +        return s_networkACLItemCidrsDao.getCidrs(id);
    +    }
    +
         public static Account getProjectOwner(long projectId) {
             return s_projectMgr.getProjectOwner(projectId);
         }
    diff --git a/server/src/com/cloud/api/ApiResponseHelper.java 
b/server/src/com/cloud/api/ApiResponseHelper.java
    index 37cb155..df4cca8 100755
    --- a/server/src/com/cloud/api/ApiResponseHelper.java
    +++ b/server/src/com/cloud/api/ApiResponseHelper.java
    @@ -2349,7 +2349,8 @@ public class ApiResponseHelper implements 
ResponseGenerator {
                 
response.setEndPort(Integer.toString(aclItem.getSourcePortEnd()));
             }
    
    -        response.setCidrList(StringUtils.join(aclItem.getSourceCidrList(), 
","));
    +        List<String> cidrs = 
ApiDBUtils.findNetworkAclItemSourceCidrs(aclItem.getId());
    +        response.setCidrList(StringUtils.join(cidrs, ","));
    
             response.setTrafficType(aclItem.getTrafficType().toString());
    
    --
    2.3.0



> UI does not display source CIDR in VPC ACL
> ------------------------------------------
>
>                 Key: CLOUDSTACK-8280
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8280
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.5.0
>            Reporter: Ramamurti Subramanian
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to