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

    https://github.com/apache/stratos/pull/277#discussion_r28768793
  
    --- Diff: 
components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
 ---
    @@ -191,52 +128,56 @@ public static StringBuilder getTextPayload (String 
appId, String groupName, Stri
             return payloadBuilder;
         }
     
    -    public static PayloadData createPayload(String appId, String 
groupName, CartridgeInfo cartridgeInfo, String subscriptionKey, int tenantId, 
String clusterId,
    +    public static PayloadData createPayload(String appId, String 
groupName, Cartridge cartridge, String subscriptionKey, int tenantId, String 
clusterId,
                                                 String hostName, String 
repoUrl, String alias, Map<String, String> customPayloadEntries, String[] 
dependencyAliases, 
                                                 
org.apache.stratos.common.Properties properties, String oauthToken,String[] 
dependencyClusterIDs,
                                                 String[] exportMetadata, 
String[] importMetadata)
                 throws ApplicationDefinitionException {
     
             //Create the payload
    -        BasicPayloadData basicPayloadData = createBasicPayload(appId, 
groupName, cartridgeInfo, subscriptionKey,
    +        BasicPayloadData basicPayloadData = createBasicPayload(appId, 
groupName, cartridge, subscriptionKey,
                     clusterId, hostName, repoUrl, alias, tenantId, 
dependencyAliases, dependencyClusterIDs,exportMetadata,importMetadata);
             //Populate the basic payload details
             basicPayloadData.populatePayload();
     
    -        PayloadData payloadData = 
PayloadFactory.getPayloadDataInstance(cartridgeInfo.getProvider(),
    -                cartridgeInfo.getType(), basicPayloadData);
    -
    -        // get the payload parameters defined in the cartridgeInfo 
definition file for this cartridgeInfo type
    -        if (cartridgeInfo.getProperties() != null && 
cartridgeInfo.getProperties().length != 0) {
    -
    -            org.apache.stratos.common.Properties cartridgeProps = 
AutoscalerUtil.toCommonProperties(cartridgeInfo.getProperties());
    -            
    -            if (cartridgeProps != null) {
    -
    -                for (Property propertyEntry : 
cartridgeProps.getProperties()) {
    -                    // check if a property is related to the payload. 
Currently
    -                    // this is done by checking if the
    -                    // property name starts with 'payload_parameter.' 
suffix. If
    -                    // so the payload param name will
    -                    // be taken as the substring from the index of '.' to 
the
    -                    // end of the property name.
    -                    if 
(propertyEntry.getName().startsWith("payload_parameter.")) {
    -                        String payloadParamName = propertyEntry.getName();
    -                        String payloadParamSubstring = 
payloadParamName.substring(payloadParamName.indexOf(".") + 1);
    -                        if ("DEPLOYMENT".equals(payloadParamSubstring)) {
    -                            
payloadData.getBasicPayloadData().setDeployment(payloadParamSubstring);
    -                            continue;
    +        PayloadData payloadData = 
PayloadFactory.getPayloadDataInstance(cartridge.getProvider(),
    +                cartridge.getType(), basicPayloadData);
    +
    +        // get the payload parameters defined in the cartridge definition 
file for this cartridge type
    +
    +        if (cartridge.getProperties() != null) {
    +            if (cartridge.getProperties().getProperties() != null && 
cartridge.getProperties().getProperties().length != 0) {
    --- End diff --
    
    This is currently being fixed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to