xebialabs-community / xlr-xlrelease-plugin

Create and start another XL Release template from a parent template
MIT License
3 stars 14 forks source link

Support of new types of variables. #16

Open Stargirly2 opened 8 years ago

Stargirly2 commented 8 years ago

Hi,

Because the ',' has been used as a variable delimiter in the input Variables. The plugin cannot handle the new variable types like lists and dictionaries. In my case I have changed the ',' delimiter in '|' as a delimiter which works fine for me. Als changed type for integer variables

def process_variables(variables, updatable_variables):
    var_map = {}
    if variables is not None:
        for variable in variables.split(**'|'**):
            var_map[variable.split('=', 1)[0]]= variable.split('=', 1)[1]

    for updatable_variable in updatable_variables:
        key = str(updatable_variable["key"]).strip("${").strip("}")
        if key in var_map:
            if var_map[key].isdigit():
                updatable_variable["value"] = int(var_map[key])
            else:
                updatable_variable["value"] = var_map[key]

    return str(updatable_variables).replace("u'","'").replace('u"','"').replace("'", '"').replace('"[','[').replace(']"',']').replace("None","null").replace("True","true").replace("False","false")
jdewinne commented 7 years ago

Sorry for the late reply. As you might have noticed, creating a sub release is now standard available. Would it be possible for you to switch to the create release task?

jdewinne commented 6 years ago

Checked for variable of type integer: That works in v2.1.0. haven't checked yet for variables of type list, map or boolean.