if the resource type is a RunningInstance or a GHN, the more recent

resource check is bypassed
This commit is contained in:
Roberto Cirillo 2019-10-23 18:44:03 +02:00
parent 8c5b74c444
commit 69ca8d374d
2 changed files with 4 additions and 0 deletions

View File

@ -446,6 +446,9 @@ public class RegistryPublisherImpl implements RegistryPublisher {
private <T extends Resource> HashSet<String> updateResourceScopes(T resource) {
HashSet<String> vosScopes = Utils.getInternalVOScopes(resource);
// if the resource type is a RunningInstance or a HostingNode the check on the most recent resource is bypassed
if((resource.type().toString().equalsIgnoreCase("RunningInstance")) || (resource.type().toString().equalsIgnoreCase("GHN")))
return vosScopes;
//extract the scopes from the more recent resource found at vo level
List <String> latestScopesFound= Utils.setLatestInternalScopes(resource, vosScopes);
log.debug("latest scope found are "+latestScopesFound);

View File

@ -154,6 +154,7 @@ public class Utils {
private static <T extends Resource> List<String> extractInternalScopes(T resource, String latestVO) {
T extractedResource=null;
log.debug("checking resource "+resource.id()+" type: "+resource.type());
if(resource.type().toString().equalsIgnoreCase("RuntimeResource")){
extractedResource= (T)getServiceEndpointByID(resource.id(), latestVO);
}else if(resource.type().toString().equalsIgnoreCase("GenericResource")){