mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 02:53:18 +01:00
bug 10410:
same template only shows once per zone status 10410: resolved fixed
This commit is contained in:
parent
8402cfaa1d
commit
bec24d533d
@ -126,6 +126,8 @@ public class ListIsosCmd extends BaseListCmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean listInReadyState() {
|
public boolean listInReadyState() {
|
||||||
|
return true;
|
||||||
|
/*
|
||||||
Account account = UserContext.current().getCaller();
|
Account account = UserContext.current().getCaller();
|
||||||
// It is account specific if account is admin type and domainId and accountName are not null
|
// It is account specific if account is admin type and domainId and accountName are not null
|
||||||
boolean isAccountSpecific = (account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
|
boolean isAccountSpecific = (account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
|
||||||
@ -134,6 +136,7 @@ public class ListIsosCmd extends BaseListCmd {
|
|||||||
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)
|
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)
|
||||||
|| (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
|
|| (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
|
||||||
return onlyReady;
|
return onlyReady;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -171,7 +174,7 @@ public class ListIsosCmd extends BaseListCmd {
|
|||||||
isAdmin = true;
|
isAdmin = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ListResponse<TemplateResponse> response = _responseGenerator.createIsoResponse(isoZonePairSet, isAdmin, account, bootable, listInReadyState());
|
ListResponse<TemplateResponse> response = _responseGenerator.createIsoResponse(isoZonePairSet, isAdmin, account, bootable, true);
|
||||||
response.setResponseName(getCommandName());
|
response.setResponseName(getCommandName());
|
||||||
this.setResponseObject(response);
|
this.setResponseObject(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,6 +107,8 @@ public class ListTemplatesCmd extends BaseListCmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean listInReadyState() {
|
public boolean listInReadyState() {
|
||||||
|
return true;
|
||||||
|
/*
|
||||||
Account account = UserContext.current().getCaller();
|
Account account = UserContext.current().getCaller();
|
||||||
// It is account specific if account is admin type and domainId and accountName are not null
|
// It is account specific if account is admin type and domainId and accountName are not null
|
||||||
boolean isAccountSpecific = (account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
|
boolean isAccountSpecific = (account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
|
||||||
@ -115,6 +117,7 @@ public class ListTemplatesCmd extends BaseListCmd {
|
|||||||
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)
|
boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)
|
||||||
|| (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
|
|| (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
|
||||||
return onlyReady;
|
return onlyReady;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -144,7 +147,7 @@ public class ListTemplatesCmd extends BaseListCmd {
|
|||||||
List<TemplateResponse> templateResponses = new ArrayList<TemplateResponse>();
|
List<TemplateResponse> templateResponses = new ArrayList<TemplateResponse>();
|
||||||
|
|
||||||
for (Pair<Long, Long> template : templateZonePairSet) {
|
for (Pair<Long, Long> template : templateZonePairSet) {
|
||||||
_responseGenerator.createTemplateResponse(templateResponses, template, isAdmin, account, listInReadyState());
|
_responseGenerator.createTemplateResponse(templateResponses, template, isAdmin, account, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
response.setResponses(templateResponses);
|
response.setResponses(templateResponses);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user