Github user imesh commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/97#discussion_r19653496
  
    --- Diff: 
components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/CloudstackIaas.java
 ---
    @@ -0,0 +1,539 @@
    +package org.apache.stratos.cloud.controller.iaases;
    +
    +
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.commons.logging.Log;
    +import org.apache.commons.logging.LogFactory;
    +import 
org.apache.stratos.cloud.controller.exception.CloudControllerException;
    +import org.apache.stratos.cloud.controller.exception.InvalidHostException;
    +import 
org.apache.stratos.cloud.controller.exception.InvalidRegionException;
    +import org.apache.stratos.cloud.controller.exception.InvalidZoneException;
    +import org.apache.stratos.cloud.controller.interfaces.Iaas;
    +import 
org.apache.stratos.cloud.controller.jcloud.ComputeServiceBuilderUtil;
    +import org.apache.stratos.cloud.controller.pojo.IaasProvider;
    +import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
    +import 
org.apache.stratos.cloud.controller.validate.CloudstackPartitionValidator;
    +import 
org.apache.stratos.cloud.controller.validate.interfaces.PartitionValidator;
    +import org.jclouds.cloudstack.CloudStackApi;
    +import org.jclouds.cloudstack.compute.options.CloudStackTemplateOptions;
    +import org.jclouds.cloudstack.domain.*;
    +import org.jclouds.cloudstack.features.VolumeApi;
    +import org.jclouds.cloudstack.options.ListPublicIPAddressesOptions;
    +import org.jclouds.cloudstack.options.ListZonesOptions;
    +import org.jclouds.compute.ComputeServiceContext;
    +import org.jclouds.compute.domain.NodeMetadata;
    +import org.jclouds.compute.domain.Template;
    +import org.jclouds.compute.domain.TemplateBuilder;
    +import org.jclouds.compute.options.TemplateOptions;
    +import org.jclouds.domain.Location;
    +
    +import java.util.Arrays;
    +import java.util.HashMap;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.concurrent.TimeoutException;
    +
    +public class CloudstackIaas extends Iaas {
    +
    +    private static final Log log = LogFactory.getLog(CloudstackIaas.class);
    +
    +    public CloudstackIaas(IaasProvider iaasProvider) {
    +        super(iaasProvider);
    +    }
    +
    +    @Override
    +    public void buildComputeServiceAndTemplate() {
    +        // builds and sets Compute Service
    +        
ComputeServiceBuilderUtil.buildDefaultComputeService(getIaasProvider());
    +        // builds and sets Template
    +        buildTemplate();
    +    }
    +
    +    @Override
    +    public void buildTemplate() {
    +
    +        IaasProvider iaasInfo = getIaasProvider();
    +
    +        //if compute service is not available
    +        if (iaasInfo.getComputeService() == null) {
    +            String msg = "Compute service is null for IaaS provider: "
    +                    + iaasInfo.getName();
    +            log.fatal(msg);
    --- End diff --
    
    In general we use log.fatal() in scenarios where the system cannot work due 
to some reason. Shall we change this to log.error()?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to