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 <d...@onecht.net>
    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



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to