|
28 | 28 |
|
29 | 29 | import com.cloud.dc.DataCenter; |
30 | 30 | import com.cloud.exception.PermissionDeniedException; |
| 31 | +import com.cloud.network.dao.NetrisProviderDao; |
31 | 32 | import com.cloud.network.dao.NsxProviderDao; |
| 33 | +import com.cloud.network.element.NetrisProviderVO; |
32 | 34 | import com.cloud.network.element.NsxProviderVO; |
33 | 35 | import org.apache.cloudstack.api.ApiErrorCode; |
34 | 36 | import org.apache.cloudstack.api.ServerApiException; |
|
41 | 43 | import org.apache.cloudstack.context.CallContext; |
42 | 44 | import org.apache.commons.codec.digest.DigestUtils; |
43 | 45 | import org.apache.commons.collections.CollectionUtils; |
| 46 | +import org.apache.commons.lang3.ObjectUtils; |
44 | 47 | import org.apache.commons.lang3.StringUtils; |
45 | 48 | import org.springframework.stereotype.Component; |
46 | 49 |
|
@@ -104,6 +107,8 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ |
104 | 107 | private VpcService _vpcSvc; |
105 | 108 | @Inject |
106 | 109 | private NsxProviderDao nsxProviderDao; |
| 110 | + @Inject |
| 111 | + private NetrisProviderDao netrisProviderDao; |
107 | 112 |
|
108 | 113 | private String supportedProtocolsForAclRules = "tcp,udp,icmp,all"; |
109 | 114 |
|
@@ -1031,10 +1036,12 @@ public NetworkACLItem moveNetworkAclRuleToNewPosition(MoveNetworkAclItemCmd move |
1031 | 1036 | } |
1032 | 1037 | final DataCenter dc = _entityMgr.findById(DataCenter.class, vpc.getZoneId()); |
1033 | 1038 | final NsxProviderVO nsxProvider = nsxProviderDao.findByZoneId(dc.getId()); |
| 1039 | + final NetrisProviderVO netrisProvider = netrisProviderDao.findByZoneId(dc.getId()); |
1034 | 1040 | List<NetworkVO> networks = _networkDao.listByAclId(lockedAcl.getId()); |
1035 | | - if (Objects.nonNull(nsxProvider) && !networks.isEmpty()) { |
| 1041 | + if (ObjectUtils.anyNotNull(nsxProvider, netrisProvider) && !networks.isEmpty()) { |
1036 | 1042 | allAclRules = getAllAclRulesSortedByNumber(lockedAcl.getId()); |
1037 | | - _networkAclMgr.reorderAclRules(vpc, networks, allAclRules); |
| 1043 | + Network.Provider networkProvider = nsxProvider != null ? Network.Provider.Nsx : Network.Provider.Netris; |
| 1044 | + _networkAclMgr.reorderAclRules(vpc, networks, allAclRules, networkProvider); |
1038 | 1045 | } |
1039 | 1046 | return networkACLItem; |
1040 | 1047 | } finally { |
|
0 commit comments