'Convert service environment attribute into dictionary of name/value pairs.'

@staticmethod
def expand_env_vars(env_variables):

    results = []
    if isinstance(env_variables, dict):
        results = [{'name': x, 'value': env_variables[x]} for x in list(env_variables.keys())]
    elif isinstance(env_variables, list):
        for evar in env_variables:
            parts = evar.split('=', 1)
            if (len(parts) == 1):
                results.append({'name': parts[0], 'value': None})
            elif (len(parts) == 2):
                results.append({'name': parts[0], 'value': parts[1]})
    return results
