Skip to content

Commit

Permalink
Support ad hoc CMDB compute service type for OTC
Browse files Browse the repository at this point in the history
Fixes #257
  • Loading branch information
Alberto Brigandì committed Jul 5, 2018
1 parent ca11ca9 commit c1824ba
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class CloudService extends CmdbDataWrapper<CloudService, CloudServiceData
public static final String OCCI_COMPUTE_SERVICE = COMPUTE_SERVICE_PREFIX + ".occi";
public static final String AWS_COMPUTE_SERVICE = "com.amazonaws.ec2";
public static final String AZURE_COMPUTE_SERVICE = "com.microsoft.azure";
public static final String OTC_COMPUTE_SERVICE = "eu.otc.compute";

public static final String CDMI_STORAGE_SERVICE = STORAGE_SERVICE_PREFIX + ".cdmi";
public static final String ONEPROVIDER_STORAGE_SERVICE = STORAGE_SERVICE_PREFIX + ".oneprovider";
Expand Down Expand Up @@ -82,7 +83,7 @@ public boolean isServiceOfType(String type) {
* @return true if the service is a OpenStack compute service
*/
public boolean isOpenStackComputeProviderService() {
return isServiceOfType(OPENSTACK_COMPUTE_SERVICE) && !isOtcComputeProviderService();
return isServiceOfType(OPENSTACK_COMPUTE_SERVICE);
}

/**
Expand All @@ -91,11 +92,7 @@ public boolean isOpenStackComputeProviderService() {
* @return true if the service is a OTC compute service
*/
public boolean isOtcComputeProviderService() {
return isServiceOfType(OPENSTACK_COMPUTE_SERVICE) && Optional
.ofNullable(getData())
// the only OST public (for now)
.filter(CloudServiceData::isPublicService)
.isPresent();
return isServiceOfType(OTC_COMPUTE_SERVICE);
}

/**
Expand Down

0 comments on commit c1824ba

Please sign in to comment.