Skip to content

Commit 26bcb9a

Browse files
niteshsardaRohit Yadav
authored andcommitted
CLOUDSTACK-9935 : Search in VPN Customer Gateway not working
(cherry picked from commit fdadc7b) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent aaae977 commit 26bcb9a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ public Pair<List<? extends Site2SiteCustomerGateway>, Integer> searchForCustomer
586586
boolean listAll = cmd.listAll();
587587
long startIndex = cmd.getStartIndex();
588588
long pageSizeVal = cmd.getPageSizeVal();
589+
String keyword = cmd.getKeyword();
589590

590591
Account caller = CallContext.current().getCallingAccount();
591592
List<Long> permittedAccounts = new ArrayList<Long>();
@@ -602,12 +603,17 @@ public Pair<List<? extends Site2SiteCustomerGateway>, Integer> searchForCustomer
602603
_accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
603604

604605
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
606+
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
605607

606608
SearchCriteria<Site2SiteCustomerGatewayVO> sc = sb.create();
607609
_accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
608610

609611
if (id != null) {
610-
sc.addAnd("id", SearchCriteria.Op.EQ, id);
612+
sc.setParameters("id", id);
613+
}
614+
if(keyword != null && !keyword.isEmpty())
615+
{
616+
sc.setParameters("name", "%" + keyword + "%");
611617
}
612618

613619
Pair<List<Site2SiteCustomerGatewayVO>, Integer> result = _customerGatewayDao.searchAndCount(sc, searchFilter);

0 commit comments

Comments
 (0)