'Migrate a v5 JSON configuration to v6.
:param bytes config: The v5 JSON data.
:return bytes: The v6 JSON data.'

@classmethod
def upgrade_from_v5(cls, config):

    decoded_config = loads(config)
    decoded_config[u'version'] = 6
    try:
        nodes = decoded_config[u'deployment'][u'nodes']
    except KeyError:
        pass
    else:
        new_node_values = []
        for node in nodes[u'values']:
            uuid = node[0]
            applications = node[1][u'applications'][u'values']
            for app in applications:
                app[1].update({u'swappiness': 0})
            new_node = node[1]
            new_node[u'applications'][u'values'] = applications
            new_node_values.append((uuid, new_node))
        decoded_config[u'deployment'][u'nodes'] = {u'values': new_node_values, _CLASS_MARKER: 'PMap'}
    return dumps(decoded_config)
